Created
May 1, 2021 18:41
-
-
Save boudhayan-dev/c4c46efe6c02a8b61df826c651429853 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@EnableWebSecurity(debug=true) | |
public class MultipleSecurityCofig extends WebSecurityConfigurerAdapter { | |
@Order(1) | |
@Configuration | |
public static class EmployeeConfig extends WebSecurityConfigurerAdapter{ | |
@Override | |
protected void configure(HttpSecurity http) throws Exception { | |
http.antMatcher("/api/v1/employee/**").authorizeRequests().antMatchers("/api/v1/employee/**").permitAll() | |
.and().sessionManagement().disable() | |
.cors().disable() | |
.csrf().disable() | |
.logout().disable() | |
.requestCache().disable() | |
.headers().disable(); | |
} | |
} | |
@Order(2) | |
@Configuration | |
public static class ManagerConfig extends WebSecurityConfigurerAdapter{ | |
@Override | |
protected void configure(HttpSecurity http) throws Exception { | |
http.antMatcher("/api/v1/manager/**").authorizeRequests().antMatchers("/api/v1/manager/**").permitAll() | |
.and().addFilterAfter(new AuditLogFilter(), FilterSecurityInterceptor.class); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment