-
Notifications
You must be signed in to change notification settings - Fork 6k
OAuth2AuthorizationCodeGrantWebFilter should not restrict redirect-uri #7036
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
Comments
Hi @jgrandja, can I try taking this issue? |
@clementkng That would be great. Let me know if you have any questions. Thanks! |
@jgrandja Thanks, right now I'm just reading through the code. A couple of opening questions:
Also, I've skimmed through the Spring Security docs, but wasn't able to find the specific section that would shed more context on this issue. Is there a guide to learning more about this code? |
@clementkng I would recommend reviewing the Authorization Code Grant flow in the spec. The section Authorization Response is implemented by After you review the spec and gain a solid understanding of the
Go through these steps for |
Hi @jgrandja, thanks for your recommendations! I've gone through the Authorization Code Grant flow and understand the higher details of what the
When you say go through, do you mean I have to physically go through the steps i.e. create a new
I'm not sure what this is referring to. |
@clementkng I think that makes a lot of sense as far as modifying the existing test When I mentioned
I was trying to answer your question
To be more clear, those steps show you how to customize the Specifically, Makes sense? |
@jgrandja Thanks for clarifying, that makes more sense to me. I believe I now have a test I can begin developing against, but I just want to make sure. If I create a new |
It's not necessary to create a new method. Just re-use what's there like this ClientRegistration registration = TestClientRegistrations.clientRegistration().redirectUriTemplate("/callback") .build();
OAuth2AuthorizationExchange exchange = TestOAuth2AuthorizationExchanges.success();
OAuth2AuthorizationCodeAuthenticationToken authenticationToken = new OAuth2AuthorizationCodeAuthenticationToken(registration, exchange); Yes, you will need to change |
@jgrandja I'm still having trouble getting the behavior of the I just wanted to let ppl know so if anyone else wants to jump in, feel free to. |
@clementkng Ok no worries. Thanks for letting me know. |
OAuth2AuthorizationCodeGrantWebFilter
currently matches the Authorization Response using the pattern/{action}/oauth2/code/{registrationId}
, which is too restrictive.We should allow the client to configure the
redirect-uri
to be anyURI
within the application. The Authorization Response matching should follow the same logic found inOAuth2AuthorizationCodeGrantFilter.shouldProcessAuthorizationResponse()
.The text was updated successfully, but these errors were encountered: