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

Allow using response_type=token with PKCE when response type permissions are enforced #2088

Merged

Conversation

kevinchalet
Copy link
Member

@kevinchalet kevinchalet commented Jun 13, 2024

Currently, OpenIddict automatically rejects all the PKCE-enabled authorization requests that specify a response_type parameter containing token as a way to mitigate downgrade attacks and prevent clients from acquiring an access token directly from the authorization endpoint without sending the valid code_verifier (which is only enforced during the token request handling).

While it's great from a security perspective, it's a bit restrictive and prevents advanced scenarios, like returning an access token with a very limited scope from the authorization endpoint and a broader access token from the token endpoint (in this case, the access granted by the first access token is so limited that it's not necessary to protect it with PKCE).

This PR relaxes the validation policy to allow using a response_type containing token with PKCE when response type permissions are enforced (and the corresponding response_type permission was enforced for the specified response_type, of course). When response type permissions are disabled, an error will still be returned as in previous versions.

@kevinchalet kevinchalet added this to the 5.7.0 milestone Jun 13, 2024
@kevinchalet kevinchalet self-assigned this Jun 13, 2024
@kevinchalet kevinchalet merged commit 02fb441 into openiddict:dev Jun 13, 2024
6 checks passed
@kevinchalet kevinchalet deleted the pkce_with_token_response_type branch June 13, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant