我能够使用Spring Security从LDAP获得身份验证并从数据库中担任角色
@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception {
auth
.ldapAuthentication()
.userSearchFilter("uid={0}")
.ldapAuthoritiesPopulator(rolesPopulator)
.contextSource(contextSource());
}
但是在启用Webflux的情况下进行相同的操作是一个挑战。
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http, ReactiveAuthenticationManager reactiveAuthenticationManager, DataApiAuthrotiyPopulator dataApiAuthrotiyPopulator) {
http
.authorizeExchange()
.anyExchange().authenticated()
.and().authenticationManager(reactiveAuthenticationManager)
.httpBasic();
return http.build();
}
是否没有添加ldapAuthoritiesPopulator的规定?