diff options
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientCredentialApplicator.cs')
-rw-r--r-- | src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientCredentialApplicator.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientCredentialApplicator.cs b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientCredentialApplicator.cs index cc4e45f..0677f5a 100644 --- a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientCredentialApplicator.cs +++ b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientCredentialApplicator.cs @@ -135,7 +135,9 @@ namespace DotNetOpenAuth.OAuth2 { clientIdentifier); } - request.Credentials = this.credential ?? new NetworkCredential(clientIdentifier, this.clientSecret); + // HttpWebRequest ignores the Credentials property until the remote server returns a 401 Unauthorized. + // So we also set the HTTP Authorization request header directly. + OAuthUtilities.ApplyHttpBasicAuth(request.Headers, clientIdentifier, this.clientSecret); } } } |