AuthenticationException shouldn't be thrown when user denies access · Issue #170 · SimpleAuthentication/SimpleAuthentication · GitHub
Skip to content

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

Open

Description

@ThomasArdal

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).

Activity

  1. ThomasArdal commented on Aug 3, 2015

    @ThomasArdal
    ContributorAuthor

    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.

  2. PureKrome commented on Aug 3, 2015

    @PureKrome
    Member

    So maybe return a null UserInformation instead?

  3. ThomasArdal commented on Aug 4, 2015

    @ThomasArdal
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions