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() |               .getPath() | ||||||
|               .subPath(0) |               .subPath(0) | ||||||
|               .value() |               .value() | ||||||
|               .startsWith("/employee")) |               .startsWith("/employee")) { | ||||||
|                 return Mono.just(employeesAuthenticationManager()); |                 return Mono.just(employeesAuthenticationManager()); | ||||||
|  |             } | ||||||
|             return Mono.just(customersAuthenticationManager()); |             return Mono.just(customersAuthenticationManager()); | ||||||
|         }; |         }; | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -27,8 +27,9 @@ public class CustomWebSecurityConfigurer extends WebSecurityConfigurerAdapter { | |||||||
|         return request -> { |         return request -> { | ||||||
|             if (request |             if (request | ||||||
|               .getPathInfo() |               .getPathInfo() | ||||||
|               .startsWith("/employee")) |               .startsWith("/employee")) { | ||||||
|                 return employeesAuthenticationManager(); |                 return employeesAuthenticationManager(); | ||||||
|  |             } | ||||||
|             return customersAuthenticationManager(); |             return customersAuthenticationManager(); | ||||||
|         }; |         }; | ||||||
|     } |     } | ||||||
| @ -63,10 +64,10 @@ public class CustomWebSecurityConfigurer extends WebSecurityConfigurerAdapter { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private AuthenticationFilter authenticationFilter() { |     private AuthenticationFilter authenticationFilter() { | ||||||
|         AuthenticationFilter ret = new AuthenticationFilter( |         AuthenticationFilter filter = new AuthenticationFilter( | ||||||
|           resolver(), authenticationConverter()); |           resolver(), authenticationConverter()); | ||||||
|         ret.setSuccessHandler((request, response, auth) -> {}); |         filter.setSuccessHandler((request, response, auth) -> {}); | ||||||
|         return ret; |         return filter; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private AuthenticationManager employeesAuthenticationManager() { |     private AuthenticationManager employeesAuthenticationManager() { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user