草庐IT

configureGlobal

全部标签

java - Spring security中registerGlobal()、configure()、configureGlobal()、configureGlobalSecurity的区别

我有以下三个代码片段,它们都在做同样的事情:创建内存身份验证。那么它如何影响以不同的方法名称定义它呢?全局注册配置配置全局配置全局安全第一个:publicvoidregisterGlobal(AuthenticationManagerBuilderauth)throwsException{auth.inMemoryAuthentication().withUser("user").password("password").roles("USER").and().withUser("admin").password("password").roles("USER","ADMIN");}}

java - Spring security中registerGlobal()、configure()、configureGlobal()、configureGlobalSecurity的区别

我有以下三个代码片段,它们都在做同样的事情:创建内存身份验证。那么它如何影响以不同的方法名称定义它呢?全局注册配置配置全局配置全局安全第一个:publicvoidregisterGlobal(AuthenticationManagerBuilderauth)throwsException{auth.inMemoryAuthentication().withUser("user").password("password").roles("USER").and().withUser("admin").password("password").roles("USER","ADMIN");}}