-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Create possibility to perform an internal forward to the consent page #1232
Comments
Can you please provide details on why you require a forward? Why is the redirect insufficient for your use case? |
@jgrandja |
I'm trying to understand why you want to minimize the redirects? Is this causing an issue? Or is it simply a preference? This is the first time we received this enhancement request so it is unlikely we would provide this enhancement at this point since it wouldn't be widely used. As an FYI, we try to minimize exposing public API's until there is a greater need for it from our users. Exposing public APIs restricts our flexibility to change things freely and we need to support it over a longer term based on our support cycle. So we only expose APIs if and when there a greater demand from our users. At this point, it is unlikely we would expose |
@jgrandja It's a preference and we would like to keep the old behavior, which was implemented with the deprecated spring security oauth2 AuthorizationEndpoint, which performed an internal forward. A forward is more performant than a redirect which requires the browser to perform an additional request. At the moment the consent endpoint retrieves the clientId, state and scope. With the state we can perform the lookup for the stored authorization which was created by the AuthRequestAuthprovider. However if custom handling like claims where implemented, they are missing in the consent redirect and this is in my opinion not coherent. It should be at least possible for the developer how the consent handling is done. And this includes how the consent (if required) is handled e.g. with a redirect (with additional parameters) or an internal forward. |
I can appreciate that you would prefer to keep with the existing logic but as you are aware Spring Authorization Server is a complete re-write from the legacy Authorization Server so changes are inevitable when migrating to Spring Authorization Server.
All the information related to the "in-flight" authorization is available to the consent controller after the redirect. Please see Line 41 in 9c1ec34
It demonstrates retrieval of For your use case, you would inject I'll leave this open for now and we'll see if other user's are looking for this capability. |
@jgrandja Yes, there's no problem in implementing the consent controller. However, for me, it feels a little bit inconsistent that the scope is passed as redirect parameter but other additional params (claims for example) have to be taken from the in-flight authorization. Whats the purpose of scope redirect param at all? I like to optimize things where possible and at this point, a forward could do that. But thanks for the discussion! I appreciate that. Lets keep this open. |
Expected Behavior
If the AuthenticationProvider decided, that a user has to give consent, the user is internally forwarded to the consent page without an additional redirect. The URI does not change in the browser.
Current Behavior
If consent is required, the user is redirected to the provided consent url. The browser performs an additional request.
Context
We would like to get rid of this additional redirect and perform an internal forward to the consent controller with the original authorization request.
Possible approach:
Make the redirectStrategy in the OAuth2AuthorizationEndpointFilter configurable to be able to perform a forward if the provided url is the consent url in a custom implementation.
The text was updated successfully, but these errors were encountered: