summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth/OAuth2/ResourceServer.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth/OAuth2/ResourceServer.cs b/src/DotNetOpenAuth/OAuth2/ResourceServer.cs
index 25af340..f013a5e 100644
--- a/src/DotNetOpenAuth/OAuth2/ResourceServer.cs
+++ b/src/DotNetOpenAuth/OAuth2/ResourceServer.cs
@@ -89,7 +89,11 @@ namespace DotNetOpenAuth.OAuth2 {
throw ErrorUtilities.ThrowProtocol("Bad access token");
} else {
- throw ErrorUtilities.ThrowProtocol("Missing access token.");
+ var response = new UnauthorizedResponse(new ProtocolException("Missing access token"));
+
+ username = null;
+ scope = null;
+ return this.Channel.PrepareResponse(response);
}
} catch (ProtocolException ex) {
var response = request != null ? new UnauthorizedResponse(request, ex) : new UnauthorizedResponse(ex);