diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-11-11 19:49:48 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-11-11 19:49:48 -0800 |
commit | 87ea97b79ba8f363ee8a61a7bf71151e6fd354c4 (patch) | |
tree | 592894f07a953c426621e3b2f6342716c0c75342 /src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/ClientCredentialHttpBasicReader.cs | |
parent | a8ac488896a6468b91b9733b5c378727bd6d6429 (diff) | |
download | DotNetOpenAuth-87ea97b79ba8f363ee8a61a7bf71151e6fd354c4.zip DotNetOpenAuth-87ea97b79ba8f363ee8a61a7bf71151e6fd354c4.tar.gz DotNetOpenAuth-87ea97b79ba8f363ee8a61a7bf71151e6fd354c4.tar.bz2 |
Fixes HTTP Basic auth challenge to include realm
Fixes #189
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/ClientCredentialHttpBasicReader.cs')
-rw-r--r-- | src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/ClientCredentialHttpBasicReader.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/ClientCredentialHttpBasicReader.cs b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/ClientCredentialHttpBasicReader.cs index 655d38f..6f0bbc4 100644 --- a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/ClientCredentialHttpBasicReader.cs +++ b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/ClientCredentialHttpBasicReader.cs @@ -7,6 +7,7 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements { using System; using System.Collections.Generic; + using System.Globalization; using System.Linq; using System.Text; using System.Web; @@ -21,10 +22,15 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements { /// Gets this module's contribution to an HTTP 401 WWW-Authenticate header so the client knows what kind of authentication this module supports. /// </summary> public override string AuthenticateHeader { - get { return "Basic"; } + get { return string.Format(CultureInfo.InvariantCulture, "Basic realm=\"{0}\"", this.Realm); } } /// <summary> + /// Gets or sets the realm that is included in an HTTP WWW-Authenticate header included in a 401 Unauthorized response. + /// </summary> + public string Realm { get; set; } + + /// <summary> /// Attempts to extract client identification/authentication information from a message. /// </summary> /// <param name="authorizationServerHost">The authorization server host.</param> |