summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthChannel.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2013-06-09 17:56:16 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2013-06-09 17:56:16 -0700
commitda9e554cd6364ac1bcf7ab23a8b5fe20e8a26192 (patch)
tree4aaef4d9e8901d09e9f3638241645c19787fd2ec /src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthChannel.cs
parentef21fed4150b6dba853f518a8467e268bb209ab7 (diff)
downloadDotNetOpenAuth-da9e554cd6364ac1bcf7ab23a8b5fe20e8a26192.zip
DotNetOpenAuth-da9e554cd6364ac1bcf7ab23a8b5fe20e8a26192.tar.gz
DotNetOpenAuth-da9e554cd6364ac1bcf7ab23a8b5fe20e8a26192.tar.bz2
Fixes the OAuthServiceProvider sample issue with recognizing protected resource requests:
Expected message DotNetOpenAuth.OAuth.Messages.AccessProtectedResourceRequest but received DotNetOpenAuth.OAuth.Messages.UserAuthorizationRequest instead. The issue was that in converting a WCF message to an HttpRequestMessage, the Authorization header was truncated (sort of), but in a way we could reassemble the original message.
Diffstat (limited to 'src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthChannel.cs')
-rw-r--r--src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthChannel.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthChannel.cs b/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthChannel.cs
index d606ff0..e68dc63 100644
--- a/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthChannel.cs
+++ b/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthChannel.cs
@@ -120,7 +120,8 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
/// <returns>The deserialized message, if one is found. Null otherwise.</returns>
protected override async Task<IDirectedProtocolMessage> ReadFromRequestCoreAsync(HttpRequestMessage request, CancellationToken cancellationToken) {
// First search the Authorization header.
- var authorization = request.Headers.Authorization;
+ AuthenticationHeaderValue authorization;
+ AuthenticationHeaderValue.TryParse(request.Headers.GetJointValues("Authorization"), out authorization);
var fields = MessagingUtilities.ParseAuthorizationHeader(Protocol.AuthorizationHeaderScheme, authorization).ToDictionary();
fields.Remove("realm"); // ignore the realm parameter, since we don't use it, and it must be omitted from signature base string.