Spring Security 中的 @EnableGlobalAuthentication 注解是干啥的,起什么作用的
Spring Security 4.2.0.RELEASE
Spring Security 中的 @EnableGlobalAuthentication 注解是干啥的,起什么作用的
Spring Security 4.2.0.RELEASE
The {@link EnableGlobalAuthentication} annotation signals that the
annotated class can * be used to configure a global instance of
{@link AuthenticationManagerBuilder}
被这个注解修饰的类,可以用来构建一个全局的AuthenticationManagerBuilder
例子:
* public class MyGlobalAuthenticationConfiguration {
*
* @Autowired
* public void configureGlobal(AuthenticationManagerBuilder auth) {
* auth.inMemoryAuthentication().withUser("user").password("password").roles("USER")
* .and().withUser("admin").password("password").roles("USER", "ADMIN");
* }
*
类似3的<sec:global-method-security pre-post-annotations="enabled"/>。权限控制...