summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ClientDescription.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2013-03-03 08:41:16 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2013-03-03 08:41:16 -0800
commit475b47ab8eaa23e064763b05539fa750accebfdc (patch)
tree785a8c82ec1d8884fc51c201c23040923cbfa6fc /src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ClientDescription.cs
parent74b6b4efd2be2680e3067f716829b0c9385ceebe (diff)
parent1fdcca1a8019189237e86907f220307e2ccd61c9 (diff)
downloadDotNetOpenAuth-475b47ab8eaa23e064763b05539fa750accebfdc.zip
DotNetOpenAuth-475b47ab8eaa23e064763b05539fa750accebfdc.tar.gz
DotNetOpenAuth-475b47ab8eaa23e064763b05539fa750accebfdc.tar.bz2
Merge branch 'OAuthSimple' into httpclient
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ClientDescription.cs')
-rw-r--r--src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ClientDescription.cs33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ClientDescription.cs b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ClientDescription.cs
index a10e1aa..6d77f14 100644
--- a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ClientDescription.cs
+++ b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ClientDescription.cs
@@ -22,15 +22,36 @@ namespace DotNetOpenAuth.OAuth2 {
private readonly string secret;
/// <summary>
- /// Initializes a new instance of the <see cref="ClientDescription"/> class.
+ /// Initializes a new instance of the <see cref="ClientDescription"/> class
+ /// to represent a confidential client (one that has an authenticating secret.)
/// </summary>
/// <param name="secret">The secret.</param>
/// <param name="defaultCallback">The default callback.</param>
- /// <param name="clientType">Type of the client.</param>
- public ClientDescription(string secret, Uri defaultCallback, ClientType clientType) {
+ public ClientDescription(string secret, Uri defaultCallback) {
+ Requires.NotNullOrEmpty(secret, "secret");
+ Requires.NotNull(defaultCallback, "defaultCallback");
+
this.secret = secret;
this.DefaultCallback = defaultCallback;
- this.ClientType = clientType;
+ this.ClientType = ClientType.Confidential;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ClientDescription"/> class
+ /// to represent a public client (one that does not have an authenticating secret.)
+ /// </summary>
+ /// <param name="defaultCallback">The default callback.</param>
+ public ClientDescription(Uri defaultCallback) {
+ Requires.NotNull(defaultCallback, "defaultCallback");
+
+ this.DefaultCallback = defaultCallback;
+ this.ClientType = ClientType.Public;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ClientDescription"/> class.
+ /// </summary>
+ protected ClientDescription() {
}
#region IClientDescription Members
@@ -42,12 +63,12 @@ namespace DotNetOpenAuth.OAuth2 {
/// <value>
/// An absolute URL; or <c>null</c> if none is registered.
/// </value>
- public Uri DefaultCallback { get; private set; }
+ public Uri DefaultCallback { get; protected set; }
/// <summary>
/// Gets the type of the client.
/// </summary>
- public ClientType ClientType { get; private set; }
+ public ClientType ClientType { get; protected set; }
/// <summary>
/// Gets a value indicating whether a non-empty secret is registered for this client.