spring-projects / spring-projects/spring-security
OAuth2LoginAuthenticationFilter not getting associated to redirect-uri attribute value
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
Describe the bug
When we try to override the default redirect uri in application.yml. i expected it to two things:
- To associate OAuth2LoginAuthenticationFilter with request pattern mentioned in the redirect-uri property
- To send this value as redirect_uri value in the authorization request to provider.
But, the observation is, it is performing only point #2 above, but still associated OAuth2LoginAuthenticationFilter with default redirect uri which is {}baseUri}/login/oauth2/code/{registrationId}
To Reproduce
Override the redirect-uri like this:
Expected behavior
Below two things should happen
- To associate OAuth2LoginAuthenticationFilter with request pattern mentioned in the redirect-uri property
- To send this value as redirect_uri value in the authorization request to provider.
And we should be able to login successfully and access any protected web page
Spring Boot version: 3.5.3
Spring Security version: 6.5.1
Java version: 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with OAuth2LoginAuthenticationFilter and the configured redirect-uri behavior described in the reproduction. Run the reported Spring Boot 3.5.3 and Spring Security 6.5.1 scenario, then verify that the filter matches the configured request pattern and that the provider receives the same redirect_uri value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- authentication, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100