-
Notifications
You must be signed in to change notification settings - Fork 370
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
Add support for extending Response Modes #591
Comments
Please take a look to the draft PR #592. Your comments are welcome! Btw. I created this issue with other username, but it is me :) |
I am curious, why is |
Hi @mitar, basically we do not use general purpose but tailored user-agents. Those are closed-source user-agents with workflows/endpoints and redirections hard-coded, they neither understand HTTP redirects nor are capable to extract values from example response {
"id_token": "..."
} Because it is a response tailored to our needs I do not think it will be useful in fosite, but if needed or there are others interested in this solution I could also include it. For now I think it will be more useful to include an example similar to what I have implemented for our case, in the |
Is your feature request related to a problem? Please describe.
Hi, for our OpenID implicit flow, we have clients with user agents that do not support redirects and fragments, but a custom agreed response for the
id_token
and redirect information.RFC 6749 Section 4.2.2 leaves open the option to provide other kind of responses:
OpenID oauth v2 multiple response types governs how
response_mode
param must behave and provides a real life example of how they can be extended:Currently
fosite
supports the standard oauth2 and openid response modesquery, fragment, form_post
but it does not have a way to provide additional ones.Describe the solution you'd like
In short, I would like that
fosite
provides an extension point to set additional response modes.The following are the proposed implementation changes to achieve it:
fosite.go
: Add an attribute tofosite.Fosite
to set aResponseModeHandler
which handles custom response modesresponse_mode_handler.go
authorize_error.go:63
: Check if response_mode is infosite.Fosite.ResponseModeHandler.ResponseModes()
and if so write error using itsWriteAuthorizeError
. It will behave similar toResponseModeFormPost
.authorize_write.go:41
: Add a extra case forfosite.Fosite.ResponseModeHandler.ResponseModes()
. It behaves similar toResponseModeFormPost
caseauthorize_request_handler.go
: AdjustParseResponseMode
to include handlerResponseModes()
in the validationDescribe alternatives you've considered
Additional context
The change is 100% backwards compatible, if no handler is register fosite provides its standard functionality, if registered fosite will include it on authorization validations, write error and write success.
Already supported
response_mode
methods won't be modified to use the new interface, they can remain explicit and hardcoded since they are standard.What do you think?
Would you be open for this contribution?
The text was updated successfully, but these errors were encountered: