//----------------------------------------------------------------------- // // Copyright (c) Outercurve Foundation. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.OAuth.Messages { using System; using DotNetOpenAuth.Messaging; /// /// A message used to redirect the user from a Service Provider to a Consumer's web site. /// /// /// The class is sealed because extra parameters are determined by the callback URI provided by the Consumer. /// [Serializable] public sealed class UserAuthorizationResponse : MessageBase, ITokenContainingMessage { /// /// Initializes a new instance of the class. /// /// The URI of the Consumer endpoint to send this message to. /// The OAuth version. internal UserAuthorizationResponse(Uri consumer, Version version) : base(MessageProtections.None, MessageTransport.Indirect, new MessageReceivingEndpoint(consumer, HttpDeliveryMethods.GetRequest), version) { } /// /// Gets or sets the Request or Access Token. /// string ITokenContainingMessage.Token { get { return this.RequestToken; } set { this.RequestToken = value; } } /// /// Gets or sets the verification code that must accompany the request to exchange the /// authorized request token for an access token. /// /// An unguessable value passed to the Consumer via the User and REQUIRED to complete the process. /// /// If the Consumer did not provide a callback URL, the Service Provider SHOULD display the value of the /// verification code, and instruct the User to manually inform the Consumer that authorization is /// completed. If the Service Provider knows a Consumer to be running on a mobile device or set-top box, /// the Service Provider SHOULD ensure that the verifier value is suitable for manual entry. /// [MessagePart("oauth_verifier", IsRequired = true, AllowEmpty = false, MinVersion = Protocol.V10aVersion)] public string VerificationCode { get; set; } /// /// Gets or sets the Request Token. /// [MessagePart("oauth_token", IsRequired = true)] internal string RequestToken { get; set; } } }