如果我没有理解错的话,AuthenticationProvider用于UserDetailsService检索用户的属性以验证Authentication对象。
问题是在下一个代码中没有配置 aAuthenticationProvider和 a UserDetailsService。
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("user").password("pass").roles("ADMIN").and().withUser("user1")
.password("pass").roles("USER");
}
Run Code Online (Sandbox Code Playgroud)
但认证服务已经设置。
我的问题是,是否有一个实现AuthenticationProvider和另一个实现UserDetailsService被添加到内部的 spring 上下文中?在这种情况下,使用的实现是什么(在内存身份验证的情况下)。
*.withUser("user").password("pass").roles("ADMIN")*配置部分是否代表UserDetailsService实现?