diff options
author | Todd Palmer <tpalmer@peaksware.com> | 2014-03-27 13:20:10 -0600 |
---|---|---|
committer | Todd Palmer <tpalmer@peaksware.com> | 2014-03-27 13:20:10 -0600 |
commit | afc9f783d09d63a03ef34242c4d6a6ca05cc427a (patch) | |
tree | eda460762e7ed83f8eea984d56e57f62288f666a /src | |
parent | 6143befc86f6e1f741a5747106236fe05e527fd5 (diff) | |
download | DotNetOpenAuth.Samples-afc9f783d09d63a03ef34242c4d6a6ca05cc427a.zip DotNetOpenAuth.Samples-afc9f783d09d63a03ef34242c4d6a6ca05cc427a.tar.gz DotNetOpenAuth.Samples-afc9f783d09d63a03ef34242c4d6a6ca05cc427a.tar.bz2 |
Fix approval denied return so it's valid
Sample will fail since PrepareResponse() will error without setting the required error field when the user denies access.
Diffstat (limited to 'src')
-rw-r--r-- | src/OAuth/OAuthAuthorizationServer/Controllers/OAuthController.cs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/OAuth/OAuthAuthorizationServer/Controllers/OAuthController.cs b/src/OAuth/OAuthAuthorizationServer/Controllers/OAuthController.cs index 4260b48..c9ab6cb 100644 --- a/src/OAuth/OAuthAuthorizationServer/Controllers/OAuthController.cs +++ b/src/OAuth/OAuthAuthorizationServer/Controllers/OAuthController.cs @@ -84,6 +84,9 @@ response = this.authorizationServer.PrepareApproveAuthorizationRequest(pendingRequest, User.Identity.Name); } else { response = this.authorizationServer.PrepareRejectAuthorizationRequest(pendingRequest); + var errorResponse = response as EndUserAuthorizationFailedResponse; + errorResponse.Error = "accesss_denied"; // see http://tools.ietf.org/id/draft-ietf-oauth-v2-31.html#rfc.section.4.1.2.1 for valid values + errorResponse.Description = "The resource owner or authorization server denied the request"; } return this.authorizationServer.Channel.PrepareResponse(response).AsActionResult(); |