Skip to content

feat(oauth2): support form_post response mode on the authorization code and implicit grants - #927

Open
ChrisJr404 wants to merge 1 commit into
authlib:mainfrom
ChrisJr404:form-post-response-mode
Open

feat(oauth2): support form_post response mode on the authorization code and implicit grants#927
ChrisJr404 wants to merge 1 commit into
authlib:mainfrom
ChrisJr404:form-post-response-mode

Conversation

@ChrisJr404

Copy link
Copy Markdown

Closes #816.

This brings the form_post response mode to the plain OAuth 2.0 authorization code and implicit grants. The OIDC grants already supported it through create_response_mode_response, so instead of duplicating anything I moved that helper down into rfc6749/parameters.py and had both the OAuth2 and OIDC grants use it.

query stays the default for the code grant and fragment for implicit, so existing responses are byte for byte unchanged. A client only gets a form post when it asks for response_mode=form_post.

An unknown response_mode value is now rejected with an invalid_request error. While wiring that up I noticed the helper's error message contained a double quote, which the error_description validator forbids, so it would have raised a ValueError instead of the intended OAuth error. I switched it to single quotes.

Added tests for both grants and a changelog entry.

@azmeuk

azmeuk commented Aug 25, 2026

Copy link
Copy Markdown
Member

Thank you for your contribution, you erroneously comited pip-cache/http-v2

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

Successfully merging this pull request may close these issues.

OAuth 2.0 Form Post Response Mode

2 participants