Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AuthenticationException shouldn't be thrown when user denies access #170

Open
ThomasArdal opened this issue Aug 3, 2015 · 3 comments
Open

Comments

@ThomasArdal
Copy link
Contributor

I get the following exception in my log:

SimpleAuthentication.Core.Exceptions.AuthenticationException: Reason: user_denied. Error: access_denied. Description: Permissions error.
at SimpleAuthentication.Core.Providers.FacebookProvider.RetrieveAuthorizationCode(NameValueCollection queryStringParameters)
at SimpleAuthentication.Core.Providers.BaseOAuth20Provider`1.AuthenticateClient(NameValueCollection queryStringParameters, String state, Uri callbackUri)
at SimpleAuthentication.Mvc.SimpleAuthenticationController.AuthenticateCallback(AuthenticateCallBackInputModel inputModel)

From what I can find in the documentation, the user_denied/access_denied is caused by the fact that the user doesn't accept your app to gain access to their account. Since this is a valid scenarion, it should be possible to identify this in your own code (I can't figure out if it's possible to hook into the authenticate callback code).

@ThomasArdal
Copy link
Contributor Author

Looks to be better support for this scenario in the Twitter provider:

Failed to accept the Twitter App Authorization. Therefore, authentication didn't proceed.

But it still throws an exception inside code that I cannot wrap in a try-catch.

@PureKrome
Copy link
Member

So maybe return a null UserInformation instead?

@ThomasArdal
Copy link
Contributor Author

I think that would be a better solution. And maybe an enum or similar
explaining what went "wrong"?

On Tue, Aug 4, 2015 at 1:05 AM Pure Krome notifications@github.com wrote:

So maybe return a null UserInformation instead?


Reply to this email directly or view it on GitHub
#170 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants