//-----------------------------------------------------------------------
//
// Copyright (c) Outercurve Foundation. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.OAuth.Messages {
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using DotNetOpenAuth.Messaging;
///
/// A direct message sent from Service Provider to Consumer in response to
/// a Consumer's request.
///
public class AuthorizedTokenResponse : MessageBase, ITokenSecretContainingMessage {
///
/// Initializes a new instance of the class.
///
/// The originating request.
protected internal AuthorizedTokenResponse(AuthorizedTokenRequest originatingRequest)
: base(MessageProtections.None, originatingRequest, originatingRequest.Version) {
}
///
/// Gets or sets the Access Token assigned by the Service Provider.
///
[MessagePart("oauth_token", IsRequired = true)]
public string AccessToken { get; set; }
///
/// 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.AccessToken; }
set { this.AccessToken = value; }
}
///
/// Gets or sets the Request or Access Token secret.
///
string ITokenSecretContainingMessage.TokenSecret {
get { return this.TokenSecret; }
set { this.TokenSecret = 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 Token Secret.
///
[MessagePart("oauth_token_secret", IsRequired = true)]
protected internal string TokenSecret { get; set; }
}
}