We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
authenticate_none fails if an empty client_secret request parameter exists
authenticate_none
client_secret
Error Stack
authlib.oauth2.rfc6749.authenticate_client - DEBUG - Authenticate examplevia "none" failed Bad Request: /token/ Error: invalid_client
To Reproduce
Register an AuthorizationCodeGrant with TOKEN_ENDPOINT_AUTH_METHODS = ['none']
AuthorizationCodeGrant
TOKEN_ENDPOINT_AUTH_METHODS = ['none']
POST /token/ grant_type: "authorization_code" code: "super-secret-generated-code" redirect_uri: "https://example.com/" client_id: "example" client_secret: ""
Expected behavior
I expect authenticate_none to ignore an empty client_secret parameter
According to the specification
Parameters sent without a value MUST be treated as if they were omitted from the request.
This would be fixed by using:
if client_id and not request.data.get('client_secret'):
instead of if client_id and 'client_secret' not in request.data:
if client_id and 'client_secret' not in request.data:
Environment:
The text was updated successfully, but these errors were encountered:
Fix authenticate_none method, via #438
01e95ad
Thanks, fixed.
Sorry, something went wrong.
lepture
No branches or pull requests
Describe the bug
authenticate_none
fails if an emptyclient_secret
request parameter existsError Stack
To Reproduce
Register an
AuthorizationCodeGrant
withTOKEN_ENDPOINT_AUTH_METHODS = ['none']
Expected behavior
I expect
authenticate_none
to ignore an emptyclient_secret
parameterAccording to the specification
This would be fixed by using:
if client_id and not request.data.get('client_secret'):
instead of
if client_id and 'client_secret' not in request.data:
Environment:
The text was updated successfully, but these errors were encountered: