//-----------------------------------------------------------------------
//
// Copyright (c) Andrew Arnott. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOAuth.Messages {
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using DotNetOAuth.Messaging;
///
/// A message used to redirect the user from a Consumer to a Service Provider's web site.
///
public class DirectUserToServiceProviderMessage : MessageBase, ITokenContainingMessage {
///
/// Initializes a new instance of the class.
///
/// The URI of the Service Provider endpoint to send this message to.
/// The request token.
internal DirectUserToServiceProviderMessage(MessageReceivingEndpoint serviceProvider, string requestToken)
: this(serviceProvider) {
this.RequestToken = requestToken;
}
///
/// Initializes a new instance of the class.
///
/// The URI of the Service Provider endpoint to send this message to.
internal DirectUserToServiceProviderMessage(MessageReceivingEndpoint serviceProvider)
: base(MessageProtections.None, MessageTransport.Indirect, serviceProvider) {
}
///
/// Gets or sets the Request or Access Token.
///
[SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "This property IS accessible by a different name.")]
string ITokenContainingMessage.Token {
get { return this.RequestToken; }
set { this.RequestToken = value; }
}
///
/// Gets the extra, non-OAuth parameters that will be included in the message.
///
public new IDictionary ExtraData {
get { return base.ExtraData; }
}
///
/// Gets or sets the Request Token obtained in the previous step.
///
///
/// The Service Provider MAY declare this parameter as REQUIRED, or
/// accept requests to the User Authorization URL without it, in which
/// case it will prompt the User to enter it manually.
///
[MessagePart("oauth_token", IsRequired = false)]
internal string RequestToken { get; set; }
///
/// Gets or sets a URL the Service Provider will use to redirect the User back
/// to the Consumer when Obtaining User Authorization is complete. Optional.
///
[MessagePart("oauth_callback", IsRequired = false)]
internal Uri Callback { get; set; }
}
}