//----------------------------------------------------------------------- // // Copyright (c) Outercurve Foundation. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.OAuth2.Messages { using System; using System.Net; using DotNetOpenAuth.Messaging; /// /// A direct message from the client to the authorization server that includes the client's credentials. /// public abstract class AuthenticatedClientRequestBase : MessageBase, IHttpDirectRequest { /// /// The backing for the property. /// private readonly WebHeaderCollection headers = new WebHeaderCollection(); /// /// Initializes a new instance of the class. /// /// The Authorization Server's access token endpoint URL. /// The version. protected AuthenticatedClientRequestBase(Uri tokenEndpoint, Version version) : base(version, MessageTransport.Direct, tokenEndpoint) { } /// /// Gets the client identifier previously obtained from the Authorization Server. /// /// The client identifier. /// /// Not required, because the client id may be communicate through alternate means like HTTP Basic authentication (the OAuth 2 spec allows a lot of freedom here). /// [MessagePart(Protocol.client_id, IsRequired = false)] public string ClientIdentifier { get; internal set; } /// /// Gets the client secret. /// /// The client secret. /// /// REQUIRED. The client secret as described in Section 2.1 (Client Credentials). OPTIONAL if no client secret was issued. /// [MessagePart(Protocol.client_secret, IsRequired = false, IsSecuritySensitive = true)] public string ClientSecret { get; internal set; } /// /// Gets the HTTP headers of the request. /// /// May be an empty collection, but must not be null. public WebHeaderCollection Headers { get { return this.headers; } } } }