//----------------------------------------------------------------------- // // Copyright (c) Outercurve Foundation. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.OAuth2.Messages { using System; using System.Collections.Generic; using System.Linq; using System.Text; using DotNetOpenAuth.Messaging; using DotNetOpenAuth.OAuth2.ChannelElements; /// /// A request from a Client to an Authorization Server to exchange an authorization code for an access token, /// and (at the authorization server's option) a refresh token. /// internal class AccessTokenAuthorizationCodeRequest : AccessTokenRequestBase { /// /// Initializes a new instance of the class. /// /// The Authorization Server's access token endpoint URL. /// The version. protected AccessTokenAuthorizationCodeRequest(Uri tokenEndpoint, Version version) : base(tokenEndpoint, version) { } /// /// Gets the type of the grant. /// /// The type of the grant. internal override GrantType GrantType { get { return Messages.GrantType.AuthorizationCode; } } /// /// Gets or sets the verification code previously communicated to the Client /// in . /// /// The verification code received from the authorization server. [MessagePart(Protocol.code, IsRequired = true)] internal string AuthorizationCode { get; set; } /// /// Gets or sets the callback URL used in /// /// /// The Callback URL used to obtain the Verification Code. /// /// /// REQUIRED, if the redirect_uri parameter was included in the authorization request as described in Section 4.1.1, and their values MUST be identical. /// [MessagePart(Protocol.redirect_uri, IsRequired = false)] internal Uri Callback { get; set; } /// /// Gets the scope of operations the client is allowed to invoke. /// protected override HashSet RequestedScope { get { return ((IAuthorizationCarryingRequest)this).AuthorizationDescription.Scope; } } } }