BAEL-3338: A Guide to AuthenticationManagerResolver in Spring Security
-Fix issues according to review
This commit is contained in:
parent
41a8ea19d3
commit
5cf5456e35
|
@ -44,8 +44,9 @@ public class CustomWebSecurityConfig {
|
|||
.getPath()
|
||||
.subPath(0)
|
||||
.value()
|
||||
.startsWith("/employee"))
|
||||
.startsWith("/employee")) {
|
||||
return Mono.just(employeesAuthenticationManager());
|
||||
}
|
||||
return Mono.just(customersAuthenticationManager());
|
||||
};
|
||||
}
|
||||
|
|
|
@ -27,8 +27,9 @@ public class CustomWebSecurityConfigurer extends WebSecurityConfigurerAdapter {
|
|||
return request -> {
|
||||
if (request
|
||||
.getPathInfo()
|
||||
.startsWith("/employee"))
|
||||
.startsWith("/employee")) {
|
||||
return employeesAuthenticationManager();
|
||||
}
|
||||
return customersAuthenticationManager();
|
||||
};
|
||||
}
|
||||
|
@ -63,10 +64,10 @@ public class CustomWebSecurityConfigurer extends WebSecurityConfigurerAdapter {
|
|||
}
|
||||
|
||||
private AuthenticationFilter authenticationFilter() {
|
||||
AuthenticationFilter ret = new AuthenticationFilter(
|
||||
AuthenticationFilter filter = new AuthenticationFilter(
|
||||
resolver(), authenticationConverter());
|
||||
ret.setSuccessHandler((request, response, auth) -> {});
|
||||
return ret;
|
||||
filter.setSuccessHandler((request, response, auth) -> {});
|
||||
return filter;
|
||||
}
|
||||
|
||||
private AuthenticationManager employeesAuthenticationManager() {
|
||||
|
|
Loading…
Reference in New Issue