-
Notifications
You must be signed in to change notification settings - Fork 6k
Confusing example - WebMvcConfigurer vs WebSecurityConfigurerAdapter #6809
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
@adamzimny I agree with your analysis, thanks for the report. Would you be able to submit a PR with the needed change? |
Can same be checked in for 5.1.x branch? Thank you. |
Actually, I'm thinking that it's not quite as simple as switching out the class reference. The issue here is that the documentation states:
And if we add the I agree with @rwinch here that the best fix would be to remove the |
Summary
In Spring Security documentation in the hello-web example here:
https://docs.spring.io/spring-security/site/docs/5.1.5.RELEASE/reference/htmlsingle/#hello-web-security-java-configuration
the code is:
This suggests that custom implementation of
WebMvcConfigurer
interface is the standard way of Spring Security configuration.Further down in the documentation usage of
WebSecurityConfigurerAdapter
is mentioned and multiple examples ofvoid configure(HttpSecurity http)
customization are given.This raises confusion about the role of
WebMvcConfigurer
in Spring Security and the use cases forWebMvcConfigurer
vsWebSecurityConfigurerAdapter
.Most likely the intention in the example was:
instead of
Version
5.1.5
Sample
Not only I got confused, Stackoverflow discussing the same:
https://stackoverflow.com/questions/53894649/difference-between-webmvcconfigurer-and-websecurityconfigureradapter
The text was updated successfully, but these errors were encountered: