-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
in: configAn issue in spring-security-configAn issue in spring-security-configstatus: invalidAn issue that we don't feel is validAn issue that we don't feel is validtype: bugA general bugA general bug
Description
I am configuring a bean of type SecurityFilterChain in a very simple spring boot application with jsp .
URI's like /
or /welcome
should be accessible by anyone
But URI /authenticate
or any other request should require authentication
Here is Security Config
@Bean
public SecurityFilterChain filterChain( HttpSecurity http , MvcRequestMatcher.Builder mvc) throws Exception {
http.csrf(AbstractHttpConfigurer::disable)
.authorizeHttpRequests(auth ->
auth.requestMatchers(mvc.pattern("/"),mvc.pattern("/welcome")).permitAll()
.anyRequest().authenticated()
)
.formLogin(Customizer.withDefaults())
.httpBasic(Customizer.withDefaults());
return http.build();
}
But it is asking me to login to every URI pattern including / and /welcome.
I have attached my sample repository on which I am facing this issue
https://github.com/dv0892/Security-Sample/tree/master
Seems like permitAll() is not working.
Please let me know if anything else is required
Metadata
Metadata
Assignees
Labels
in: configAn issue in spring-security-configAn issue in spring-security-configstatus: invalidAn issue that we don't feel is validAn issue that we don't feel is validtype: bugA general bugA general bug