how to use .antMatchers("/").not() method in spring security, and i am using spring MVC

124 views Asked by At

I wanted to permit 100 url's if the user do not have the given permission and also want to restrict him only to a single page, how can i do it using spring security, or can someone help me with antMatchers() to proceed with my requirement, thank you in advance.

protected void configure(HttpSecurity http) throws Exception {
     http 
    .authorizeRequests() .antMatchers("/p1/**").permitAll() 
 .antMatchers("/p2","/p3","/p4").wantRestrictIfItHasRole.access("hasRole('ROLEA')") 
    .anyRequest().authenticated();
}
0

There are 0 answers