summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AuthenticatedClientRequestBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AuthenticatedClientRequestBase.cs')
-rw-r--r--src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AuthenticatedClientRequestBase.cs22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AuthenticatedClientRequestBase.cs b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AuthenticatedClientRequestBase.cs
index bc4d0ca..4631d83 100644
--- a/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AuthenticatedClientRequestBase.cs
+++ b/src/DotNetOpenAuth.OAuth2.ClientAuthorization/OAuth2/Messages/AuthenticatedClientRequestBase.cs
@@ -6,13 +6,18 @@
namespace DotNetOpenAuth.OAuth2.Messages {
using System;
-
+ using System.Net;
using DotNetOpenAuth.Messaging;
/// <summary>
/// A direct message from the client to the authorization server that includes the client's credentials.
/// </summary>
- public abstract class AuthenticatedClientRequestBase : MessageBase {
+ public abstract class AuthenticatedClientRequestBase : MessageBase, IHttpDirectRequest {
+ /// <summary>
+ /// The backing for the <see cref="Headers"/> property.
+ /// </summary>
+ private readonly WebHeaderCollection headers = new WebHeaderCollection();
+
/// <summary>
/// Initializes a new instance of the <see cref="AuthenticatedClientRequestBase"/> class.
/// </summary>
@@ -26,7 +31,10 @@ namespace DotNetOpenAuth.OAuth2.Messages {
/// Gets the client identifier previously obtained from the Authorization Server.
/// </summary>
/// <value>The client identifier.</value>
- [MessagePart(Protocol.client_id, IsRequired = true)]
+ /// <remarks>
+ /// 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).
+ /// </remarks>
+ [MessagePart(Protocol.client_id, IsRequired = false)]
public string ClientIdentifier { get; internal set; }
/// <summary>
@@ -38,5 +46,13 @@ namespace DotNetOpenAuth.OAuth2.Messages {
/// </remarks>
[MessagePart(Protocol.client_secret, IsRequired = false)]
public string ClientSecret { get; internal set; }
+
+ /// <summary>
+ /// Gets the HTTP headers of the request.
+ /// </summary>
+ /// <value>May be an empty collection, but must not be <c>null</c>.</value>
+ public WebHeaderCollection Headers {
+ get { return this.headers; }
+ }
}
} \ No newline at end of file