summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2012-04-22 08:00:42 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2012-04-22 08:00:42 -0700
commit94d1c68291865dc4557c599ce19cbec3c10541ff (patch)
treef4037266b384f92435b8132a80ea917befa92c32 /src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs
parent1b6d8c2a40a019b43b252102353170380872da45 (diff)
downloadDotNetOpenAuth-94d1c68291865dc4557c599ce19cbec3c10541ff.zip
DotNetOpenAuth-94d1c68291865dc4557c599ce19cbec3c10541ff.tar.gz
DotNetOpenAuth-94d1c68291865dc4557c599ce19cbec3c10541ff.tar.bz2
Fixes access denial errors from OAuth 2 resource servers so they include the required parameters in their WWW-Authenticate headers.
Fixes #124
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs')
-rw-r--r--src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs b/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs
index 22514b4..e9d596a 100644
--- a/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs
+++ b/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs
@@ -101,7 +101,7 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements {
protected override OutgoingWebResponse PrepareDirectResponse(IProtocolMessage response) {
var webResponse = new OutgoingWebResponse();
- // The only direct response from a resource server is a 401 Unauthorized error.
+ // The only direct response from a resource server is some authorization error (400, 401, 403).
var unauthorizedResponse = response as UnauthorizedResponse;
ErrorUtilities.VerifyInternal(unauthorizedResponse != null, "Only unauthorized responses are expected.");
@@ -113,7 +113,7 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements {
// Now serialize all the message parts into the WWW-Authenticate header.
var fields = this.MessageDescriptions.GetAccessor(response);
- webResponse.Headers[HttpResponseHeader.WwwAuthenticate] = MessagingUtilities.AssembleAuthorizationHeader(Protocol.BearerHttpAuthorizationScheme, fields);
+ webResponse.Headers[HttpResponseHeader.WwwAuthenticate] = MessagingUtilities.AssembleAuthorizationHeader(unauthorizedResponse.Scheme, fields);
return webResponse;
}