-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Random error location response ~ OAuth2AuthorizationCodeRequestAuthenticationProvider #1002
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
Please review Section 4.1.1. Authorization Request to understand the validation required for the Authorization Request.
|
Hi @jgrandja, I've reviewed the suggested section, unfortunately I couldn't find any mention of picking a random value when a
Ie. when the |
@dlehammer I don't understand what you mean by:
What random value are you referring to? If you feel there is a bug, please provide a test that reproduces the issue so I can better understand your use case. |
…stred client, in-order to expose #1002 symptom. @see spring-projects/spring-authorization-server#1002 (comment)
Hi @jgrandja, Thanks for taking the time to reply. I'll try to elaborate, my use-case was initially as follows; enable PKCE for a registred-client on the auth-server that has a large number of The symptom in this issue was exposed, when attempting to debug the error handling in the client on the local dev-env (127.0.0.1). I've created a sample (based on default-authorizationserver) to illustrate the symptom (this commit triggers the symptom):
Notice how the response "Redirected URL" ("http://u.41/..") doesn't match the valid request Proposed mitigationI think the sensible response should reflect known valid values from the original request. |
Ie. without mitigation the user-agent can potentially end up on any registered Known "workaround" for unpredictable client redirect from server-side error-handlingRemove all but 1 |
@dlehammer Thanks for providing the details. I believe the fix that is in this PR gh-1013 will resolve your issue as well. Can you confirm? |
Seems plausible ~ based on debug state Albeit I think the usage in gh-1013 is too unrestricted ~ ie. the |
@dlehammer Thanks for confirming. FYI, we have existing test coverage for |
Describe the bug
When the authentication request query parameter; client ID, grant type or PKCE triggers an authorization code error, a random client redirect URI is returned as 302 Location.
~ see also orange markings:

From:
spring-authorization-server/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2AuthorizationCodeRequestAuthenticationProvider.java
Line 101 in 9179881
Symptom discovered in spring-authorization-server v0.4.0.
To Reproduce
2.1 utilize the clients last registered redirect URI as query parameter
Expected behavior
When the authentication request contains a valid redirect URI, I would expect the 302 Location to reflect the initial request.
The text was updated successfully, but these errors were encountered: