Thanks to visit codestin.com
Credit goes to github.com

Skip to content

oauth2 raise_from_error raises random error for invalid_request #776

@remko

Description

@remko

When an OAuth2 call fails, raise_from_error loops through all defined exceptions in errors.py to find one that matches the returned error code. However, the invalid_request error code is defined on a base class InvalidRequestFatalError that is implemented by several specific errors. The result is that, when an invalid_request happens, a random class is raised to the calling client.

For example, I hade the following happen:

oauthlib.oauth2.rfc6749.errors.InvalidClientIdError: (invalid_request) Missing required parameter: refresh_token

(which is obviously not an InvalidClientIdError)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions