summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/ClientCredentialHttpBasicReader.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/ClientCredentialHttpBasicReader.cs')
-rw-r--r--src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/ClientCredentialHttpBasicReader.cs22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/ClientCredentialHttpBasicReader.cs b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/ClientCredentialHttpBasicReader.cs
index b375d29..44af332 100644
--- a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/ClientCredentialHttpBasicReader.cs
+++ b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/ClientCredentialHttpBasicReader.cs
@@ -16,34 +16,22 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements {
/// <summary>
/// Reads client authentication information from the HTTP Authorization header via Basic authentication.
/// </summary>
- public class ClientCredentialHttpBasicReader : ClientAuthenticationModuleBase {
- /// <summary>
- /// The authorization server host.
- /// </summary>
- private readonly IAuthorizationServerHost authorizationServerHost;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ClientCredentialHttpBasicReader"/> class.
- /// </summary>
- /// <param name="authorizationServerHost">The authorization server host.</param>
- public ClientCredentialHttpBasicReader(IAuthorizationServerHost authorizationServerHost) {
- Requires.NotNull(authorizationServerHost, "authorizationServerHost");
- this.authorizationServerHost = authorizationServerHost;
- }
-
+ public class ClientCredentialHttpBasicReader : ClientAuthenticationModule {
/// <summary>
/// Attempts to extract client identification/authentication information from a message.
/// </summary>
+ /// <param name="authorizationServerHost">The authorization server host.</param>
/// <param name="requestMessage">The incoming message.</param>
/// <param name="clientIdentifier">Receives the client identifier, if one was found.</param>
/// <returns>The level of the extracted client information.</returns>
- public override ClientAuthenticationResult TryAuthenticateClient(AuthenticatedClientRequestBase requestMessage, out string clientIdentifier) {
+ public override ClientAuthenticationResult TryAuthenticateClient(IAuthorizationServerHost authorizationServerHost, AuthenticatedClientRequestBase requestMessage, out string clientIdentifier) {
+ Requires.NotNull(authorizationServerHost, "authorizationServerHost");
Requires.NotNull(requestMessage, "requestMessage");
var credential = OAuthUtilities.ParseHttpBasicAuth(requestMessage.Headers);
if (credential != null) {
clientIdentifier = credential.UserName;
- return TryAuthenticateClient(this.authorizationServerHost, credential.UserName, credential.Password);
+ return TryAuthenticateClient(authorizationServerHost, credential.UserName, credential.Password);
}
clientIdentifier = null;