@Autowired
public void configureGlobal(final AuthenticationManagerBuilder auth, final AuthenticationProvider provider) throws Exception {
auth
.eraseCredentials(false)
.authenticationProvider(provider)
.authenticationProvider(jwtConfig.jwtAuthenticationProvider());
}
@Bean("myUserDetailService")
public UserDetailsService userDetailsService() {
final LdapUserDetailsService ldapUserDetailsService = new LdapUserDetailsService(ldapUserSearch(), ldapAuthoritiesPopulator());
return new CompositeUserDetailsService(Arrays.asList(technicalUserDetailsService(), ldapUserDetailsService));
}
@Bean("myUserDetailService")
@Profile("DEV")
public UserDetailsService devUserDetailsService() {
useAnonymous = true;
InMemoryUserDetailsManagerBuilder b = new InMemoryUserDetailsManagerBuilder()
.withUser("guest").password("guest").authorities(ROLE_USER, ROLE_ADMIN).and();
return new CompositeUserDetailsService(Arrays.asList(b.build(),
technicalUserDetailsService()));
}
@Bean("myAuthProvider")
public AuthenticationProvider ldapAuthenticationProvider() {
final BindAuthenticator ba = new BindAuthenticator((BaseLdapPathContextSource) contextSource());
ba.setUserSearch(ldapUserSearch());
return new LdapAuthenticationProvider(ba, ldapAuthoritiesPopulator());
}
@Bean("myAuthProvider")
@Profile("DEV")
public AuthenticationProvider devAuthenticationProvider() {
//find a way to return userdetails here
}
有一个错误,我无法弄清楚如何解决它。
错误:'operator>>'的模糊重载在'std :: cin>> qualifyForDiscount'
请帮帮我。