-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Open
Labels
in: configAn issue in spring-security-configAn issue in spring-security-configstatus: ideal-for-contributionAn issue that we actively are looking for someone to help us withAn issue that we actively are looking for someone to help us withtype: enhancementA general enhancementA general enhancement
Description
Describe the bug
HttpSecurity configuration with securityMatcher and oauth2Login(withDefaults()) leads to 404 for some OAuth2 endpoints.
To Reproduce
- Clone this repo: https://github.com/Haarolean/spring-security-matchers-bug
- Run the app
- Go to
http://localhost:8080/oauth2/authorization/github - Observe 404
Also,
- Commenting line 25 in
OAuthSecurityConfigfixes the issue. - Endpoint like
http://localhost:1337/login/oauth2/code/github?code=xxxstill works for some reason. - I've traced the issue down to
MvcRequestMatcher, wherenotMatchMethodOrServletPathalways results intrue. Without line 25,MvcRequestMatcheris not used, ratherAnyRequestMatcheris being used. - I've dug through all the possible documentation on
securityMatcherand didn't find anything which could explain the problem.
Expected behavior
oauth, csrf, cors and other configurations are applied only for /api/web/**.
Sample
Metadata
Metadata
Assignees
Labels
in: configAn issue in spring-security-configAn issue in spring-security-configstatus: ideal-for-contributionAn issue that we actively are looking for someone to help us withAn issue that we actively are looking for someone to help us withtype: enhancementA general enhancementA general enhancement