diff options
10 files changed, 124 insertions, 124 deletions
diff --git a/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessToken.cs b/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessToken.cs index 9f671ec..bbd9f5e 100644 --- a/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessToken.cs +++ b/src/DotNetOpenAuth/OAuth2/ChannelElements/AccessToken.cs @@ -41,7 +41,7 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements { /// Gets or sets the lifetime of the access token. /// </summary> /// <value>The lifetime.</value> - [MessagePart] + [MessagePart(Encoder = typeof(TimespanSecondsEncoder))] internal TimeSpan? Lifetime { get; set; } /// <summary> diff --git a/src/DotNetOpenAuth/OAuth2/ClientBase.cs b/src/DotNetOpenAuth/OAuth2/ClientBase.cs index 7a49f53..48c9913 100644 --- a/src/DotNetOpenAuth/OAuth2/ClientBase.cs +++ b/src/DotNetOpenAuth/OAuth2/ClientBase.cs @@ -184,13 +184,13 @@ namespace DotNetOpenAuth.OAuth2 { } authorizationState.SaveChanges(); - }
-
- /// <summary>
- /// Updates authorization state with a success response from the Authorization Server.
- /// </summary>
- /// <param name="authorizationState">The authorization state to update.</param>
- /// <param name="authorizationSuccess">The authorization success message obtained from the authorization server.</param>
+ } + + /// <summary> + /// Updates authorization state with a success response from the Authorization Server. + /// </summary> + /// <param name="authorizationState">The authorization state to update.</param> + /// <param name="authorizationSuccess">The authorization success message obtained from the authorization server.</param> internal void UpdateAuthorizationWithResponse(IAuthorizationState authorizationState, EndUserAuthorizationSuccessAuthCodeResponse authorizationSuccess) { Contract.Requires<ArgumentNullException>(authorizationState != null, "authorizationState"); Contract.Requires<ArgumentNullException>(authorizationSuccess != null, "authorizationSuccess"); diff --git a/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenAssertionRequest.cs b/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenAssertionRequest.cs index e708925..b0dced4 100644 --- a/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenAssertionRequest.cs +++ b/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenAssertionRequest.cs @@ -9,17 +9,17 @@ namespace DotNetOpenAuth.OAuth2.Messages { using System.Collections.Generic; using System.Linq; using System.Text; - using DotNetOpenAuth.Messaging;
-
- /// <summary>
- /// A request from a Client to an Authorization Server to exchange some assertion for an access token.
- /// </summary>
- internal class AccessTokenAssertionRequest : AccessTokenRequestBase {
- /// <summary>
- /// Initializes a new instance of the <see cref="AccessTokenAssertionRequest"/> class.
- /// </summary>
- /// <param name="tokenEndpoint">The Authorization Server's access token endpoint URL.</param>
- /// <param name="version">The version.</param>
+ using DotNetOpenAuth.Messaging; + + /// <summary> + /// A request from a Client to an Authorization Server to exchange some assertion for an access token. + /// </summary> + internal class AccessTokenAssertionRequest : AccessTokenRequestBase { + /// <summary> + /// Initializes a new instance of the <see cref="AccessTokenAssertionRequest"/> class. + /// </summary> + /// <param name="tokenEndpoint">The Authorization Server's access token endpoint URL.</param> + /// <param name="version">The version.</param> internal AccessTokenAssertionRequest(Uri tokenEndpoint, Version version) : base(tokenEndpoint, version) { } @@ -36,12 +36,12 @@ namespace DotNetOpenAuth.OAuth2.Messages { /// </summary> /// <value>The assertion.</value> [MessagePart(Protocol.assertion, IsRequired = true, AllowEmpty = false)] - internal string Assertion { get; set; }
-
- /// <summary>
- /// Gets the type of the grant.
- /// </summary>
- /// <value>The type of the grant.</value>
+ internal string Assertion { get; set; } + + /// <summary> + /// Gets the type of the grant. + /// </summary> + /// <value>The type of the grant.</value> internal override GrantType GrantType { get { return GrantType.Assertion; } } diff --git a/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenAuthorizationCodeRequest.cs b/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenAuthorizationCodeRequest.cs index 35da4d0..67afdcb 100644 --- a/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenAuthorizationCodeRequest.cs +++ b/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenAuthorizationCodeRequest.cs @@ -12,11 +12,11 @@ namespace DotNetOpenAuth.OAuth2.Messages { using System.Text; using DotNetOpenAuth.Messaging; - using DotNetOpenAuth.OAuth2.ChannelElements;
-
- /// <summary>
- /// A request from a Client to an Authorization Server to exchange an authorization code for an access token.
- /// </summary>
+ using DotNetOpenAuth.OAuth2.ChannelElements; + + /// <summary> + /// A request from a Client to an Authorization Server to exchange an authorization code for an access token. + /// </summary> internal class AccessTokenAuthorizationCodeRequest : AccessTokenRequestBase, ITokenCarryingRequest { /// <summary> /// Initializes a new instance of the <see cref="AccessTokenAuthorizationCodeRequest"/> class. @@ -25,12 +25,12 @@ namespace DotNetOpenAuth.OAuth2.Messages { /// <param name="version">The version.</param> internal AccessTokenAuthorizationCodeRequest(Uri tokenEndpoint, Version version) : base(tokenEndpoint, version) { - }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="AccessTokenAuthorizationCodeRequest"/> class.
- /// </summary>
- /// <param name="authorizationServer">The authorization server.</param>
+ } + + /// <summary> + /// Initializes a new instance of the <see cref="AccessTokenAuthorizationCodeRequest"/> class. + /// </summary> + /// <param name="authorizationServer">The authorization server.</param> internal AccessTokenAuthorizationCodeRequest(AuthorizationServerDescription authorizationServer) : this(authorizationServer.TokenEndpoint, authorizationServer.Version) { @@ -57,12 +57,12 @@ namespace DotNetOpenAuth.OAuth2.Messages { /// <summary> /// Gets or sets the authorization that the token describes. /// </summary> - IAuthorizationDescription ITokenCarryingRequest.AuthorizationDescription { get; set; }
-
- /// <summary>
- /// Gets the type of the grant.
- /// </summary>
- /// <value>The type of the grant.</value>
+ IAuthorizationDescription ITokenCarryingRequest.AuthorizationDescription { get; set; } + + /// <summary> + /// Gets the type of the grant. + /// </summary> + /// <value>The type of the grant.</value> internal override GrantType GrantType { get { return Messages.GrantType.AuthorizationCode; } } diff --git a/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenClientCredentialsRequest.cs b/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenClientCredentialsRequest.cs index 4aab6a8..87ff8f0 100644 --- a/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenClientCredentialsRequest.cs +++ b/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenClientCredentialsRequest.cs @@ -28,12 +28,12 @@ namespace DotNetOpenAuth.OAuth2.Messages { internal AccessTokenClientCredentialsRequest(Uri tokenEndpoint, Version version) : base(tokenEndpoint, version) { this.HttpMethods = HttpDeliveryMethods.PostRequest; - }
-
- /// <summary>
- /// Gets the type of the grant.
- /// </summary>
- /// <value>The type of the grant.</value>
+ } + + /// <summary> + /// Gets the type of the grant. + /// </summary> + /// <value>The type of the grant.</value> internal override GrantType GrantType { get { return Messages.GrantType.None; } } diff --git a/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenRefreshRequest.cs b/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenRefreshRequest.cs index 4c05b2d..fe48efb 100644 --- a/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenRefreshRequest.cs +++ b/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenRefreshRequest.cs @@ -61,12 +61,12 @@ namespace DotNetOpenAuth.OAuth2.Messages { /// REQUIRED. The refresh token associated with the access token to be refreshed. /// </remarks> [MessagePart(Protocol.refresh_token, IsRequired = true, AllowEmpty = false)] - internal string RefreshToken { get; set; }
-
- /// <summary>
- /// Gets the type of the grant.
- /// </summary>
- /// <value>The type of the grant.</value>
+ internal string RefreshToken { get; set; } + + /// <summary> + /// Gets the type of the grant. + /// </summary> + /// <value>The type of the grant.</value> internal override GrantType GrantType { get { return Messages.GrantType.RefreshToken; } } diff --git a/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenRequestBase.cs b/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenRequestBase.cs index 204df61..0783ba2 100644 --- a/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenRequestBase.cs +++ b/src/DotNetOpenAuth/OAuth2/Messages/AccessTokenRequestBase.cs @@ -33,12 +33,12 @@ namespace DotNetOpenAuth.OAuth2.Messages { /// </summary> /// <value>The type of the grant.</value> [MessagePart(Protocol.grant_type, IsRequired = true, AllowEmpty = false, Encoder = typeof(GrantTypeEncoder))] - internal abstract GrantType GrantType { get; }
-
- /// <summary>
- /// Gets the set of scopes the Client would like the access token to provide access to.
- /// </summary>
- /// <value>A set of scopes. Never null.</value>
+ internal abstract GrantType GrantType { get; } + + /// <summary> + /// Gets the set of scopes the Client would like the access token to provide access to. + /// </summary> + /// <value>A set of scopes. Never null.</value> [MessagePart(Protocol.scope, IsRequired = false, AllowEmpty = true, Encoder = typeof(ScopeEncoder))] internal HashSet<string> Scope { get; private set; } diff --git a/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessAccessTokenResponse.cs b/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessAccessTokenResponse.cs index 060c12e..f33c8f3 100644 --- a/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessAccessTokenResponse.cs +++ b/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessAccessTokenResponse.cs @@ -43,38 +43,38 @@ namespace DotNetOpenAuth.OAuth2.Messages { ((IMessageWithClientState)this).ClientState = request.ClientState; } - #region ITokenCarryingRequest Members
-
- /// <summary>
- /// Gets or sets the verification code or refresh/access token.
- /// </summary>
- /// <value>The code or token.</value>
+ #region ITokenCarryingRequest Members + + /// <summary> + /// Gets or sets the verification code or refresh/access token. + /// </summary> + /// <value>The code or token.</value> string ITokenCarryingRequest.CodeOrToken { get { return this.AccessToken; } set { this.AccessToken = value; } - }
-
- /// <summary>
- /// Gets the type of the code or token.
- /// </summary>
- /// <value>The type of the code or token.</value>
+ } + + /// <summary> + /// Gets the type of the code or token. + /// </summary> + /// <value>The type of the code or token.</value> CodeOrTokenType ITokenCarryingRequest.CodeOrTokenType { get { return CodeOrTokenType.AccessToken; } - }
-
- /// <summary>
- /// Gets or sets the authorization that the token describes.
- /// </summary>
- /// <value></value>
+ } + + /// <summary> + /// Gets or sets the authorization that the token describes. + /// </summary> + /// <value></value> IAuthorizationDescription ITokenCarryingRequest.AuthorizationDescription { get; set; } - #endregion
-
- /// <summary>
- /// Gets or sets the access token.
- /// </summary>
- /// <value>The access token.</value>
- [MessagePart(Protocol.access_token, AllowEmpty = false, IsRequired = true)]
- internal string AccessToken { get; set; }
+ #endregion + + /// <summary> + /// Gets or sets the access token. + /// </summary> + /// <value>The access token.</value> + [MessagePart(Protocol.access_token, AllowEmpty = false, IsRequired = true)] + internal string AccessToken { get; set; } } } diff --git a/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessAuthCodeResponse.cs b/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessAuthCodeResponse.cs index 4ac0ec0..085a530 100644 --- a/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessAuthCodeResponse.cs +++ b/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessAuthCodeResponse.cs @@ -5,9 +5,9 @@ //----------------------------------------------------------------------- namespace DotNetOpenAuth.OAuth2.Messages { - using System;
- using System.Diagnostics.Contracts;
-
+ using System; + using System.Diagnostics.Contracts; + using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OAuth2.ChannelElements; @@ -40,43 +40,43 @@ namespace DotNetOpenAuth.OAuth2.Messages { ((IMessageWithClientState)this).ClientState = request.ClientState; } - #region ITokenCarryingRequest Members
-
- /// <summary>
- /// Gets or sets the verification code or refresh/access token.
- /// </summary>
- /// <value>The code or token.</value>
+ #region ITokenCarryingRequest Members + + /// <summary> + /// Gets or sets the verification code or refresh/access token. + /// </summary> + /// <value>The code or token.</value> string ITokenCarryingRequest.CodeOrToken { get { return this.AuthorizationCode; } set { this.AuthorizationCode = value; } - }
-
- /// <summary>
- /// Gets the type of the code or token.
- /// </summary>
- /// <value>The type of the code or token.</value>
+ } + + /// <summary> + /// Gets the type of the code or token. + /// </summary> + /// <value>The type of the code or token.</value> CodeOrTokenType ITokenCarryingRequest.CodeOrTokenType { get { return CodeOrTokenType.AuthorizationCode; } - }
-
- /// <summary>
- /// Gets or sets the authorization that the token describes.
- /// </summary>
+ } + + /// <summary> + /// Gets or sets the authorization that the token describes. + /// </summary> IAuthorizationDescription ITokenCarryingRequest.AuthorizationDescription { get; set; } - #endregion
-
- /// <summary>
- /// Gets or sets the authorization code.
- /// </summary>
- /// <value>The authorization code.</value>
+ #endregion + + /// <summary> + /// Gets or sets the authorization code. + /// </summary> + /// <value>The authorization code.</value> [MessagePart(Protocol.code, AllowEmpty = false, IsRequired = true)] - internal string AuthorizationCode { get; set; }
-
- /// <summary>
- /// Gets or sets the access token.
- /// </summary>
- /// <value>The access token.</value>
+ internal string AuthorizationCode { get; set; } + + /// <summary> + /// Gets or sets the access token. + /// </summary> + /// <value>The access token.</value> [MessagePart(Protocol.access_token, AllowEmpty = false, IsRequired = false)] internal string AccessToken { get; set; } } diff --git a/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessResponseBase.cs b/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessResponseBase.cs index 2d02b87..4a6aaf1 100644 --- a/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessResponseBase.cs +++ b/src/DotNetOpenAuth/OAuth2/Messages/EndUserAuthorizationSuccessResponseBase.cs @@ -52,22 +52,22 @@ namespace DotNetOpenAuth.OAuth2.Messages { /// REQUIRED if the Client sent the value in the <see cref="EndUserAuthorizationRequest"/>. /// </remarks> [MessagePart(Protocol.state, IsRequired = false, AllowEmpty = true)] - string IMessageWithClientState.ClientState { get; set; }
-
+ string IMessageWithClientState.ClientState { get; set; } + /// <summary> /// Gets the scope of the <see cref="AccessToken"/> if one is given; otherwise the scope of the authorization code. /// </summary> /// <value>The scope.</value> [MessagePart(Protocol.scope, IsRequired = false, AllowEmpty = true, Encoder = typeof(ScopeEncoder))] - public ICollection<string> Scope { get; private set; }
-
+ public ICollection<string> Scope { get; private set; } + /// <summary> /// Gets or sets the lifetime of the authorization. /// </summary> /// <value>The lifetime.</value> [MessagePart(Protocol.expires_in, IsRequired = false, Encoder = typeof(TimespanSecondsEncoder))] - internal TimeSpan? Lifetime { get; set; }
-
+ internal TimeSpan? Lifetime { get; set; } + /// <summary> /// Gets or sets the authorizing user's account name. /// </summary> |