//----------------------------------------------------------------------- // // Copyright (c) Andrew Arnott. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOAuth.Messages { using System.Diagnostics.CodeAnalysis; using DotNetOAuth.Messaging; /// /// A message attached to a request for protected resources that provides the necessary /// credentials to be granted access to those resources. /// public class AccessProtectedResourceRequest : SignedMessageBase, ITokenContainingMessage { /// /// Initializes a new instance of the class. /// /// The URI of the Service Provider endpoint to send this message to. protected internal AccessProtectedResourceRequest(MessageReceivingEndpoint serviceProvider) : base(MessageTransport.Direct, serviceProvider) { } /// /// Gets or sets the 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 Access Token. /// /// /// In addition to just allowing OAuth to verify a valid message, /// this property is useful on the Service Provider to verify that the access token /// has proper authorization for the resource being requested, and to know the /// context around which user provided the authorization. /// [MessagePart("oauth_token", IsRequired = true)] public string AccessToken { get; set; } } }