//----------------------------------------------------------------------- // // Copyright (c) Outercurve Foundation. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.OpenId.Extensions.OAuth { using System; using DotNetOpenAuth.Messaging; /// /// The OAuth response that a Provider may include with a positive /// OpenID identity assertion with an approved request token. /// [Serializable] public class AuthorizationApprovedResponse : ExtensionBase { /// /// The factory method that may be used in deserialization of this message. /// internal static readonly StandardOpenIdExtensionFactory.CreateDelegate Factory = (typeUri, data, baseMessage, isProviderRole) => { if (typeUri == Constants.TypeUri && !isProviderRole && data.ContainsKey(Constants.RequestTokenParameter)) { return new AuthorizationApprovedResponse(); } return null; }; /// /// Initializes a new instance of the class. /// public AuthorizationApprovedResponse() : base(new Version(1, 0), Constants.TypeUri, null) { } /// /// Gets or sets the user-approved request token. /// /// The request token. [MessagePart(Constants.RequestTokenParameter, IsRequired = true, AllowEmpty = false)] public string RequestToken { get; set; } /// /// Gets or sets a string that encodes, in a way possibly specific to the Combined Provider, one or more scopes that the returned request token is valid for. This will typically indicate a subset of the scopes requested in Section 8. /// [MessagePart("scope", IsRequired = false, AllowEmpty = true)] public string Scope { get; set; } } }