BAEL-3338: A Guide to AuthenticationManagerResolver in Spring Security

-Fix issues according to review
This commit is contained in:
maryarm 2019-12-14 19:26:34 +03:30
parent 41a8ea19d3
commit 5cf5456e35
2 changed files with 7 additions and 5 deletions

View File

@ -44,8 +44,9 @@ public class CustomWebSecurityConfig {
.getPath()
.subPath(0)
.value()
.startsWith("/employee"))
.startsWith("/employee")) {
return Mono.just(employeesAuthenticationManager());
}
return Mono.just(customersAuthenticationManager());
};
}

View File

@ -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() {