只能使用 "生成的安全密码" 进行登录。
- 论坛
- 只能使用 "生成的安全密码" 进行登录。
15 浏览
只能使用 "生成的安全密码" 进行登录。
这是我的SecurityConfig
@Configuration @EnableGlobalMethodSecurity ( securedEnabled = true ) public class SecurityConfig extends WebSecurityConfigurerAdapter { @Autowired public void configureAuth(AuthenticationManagerBuilder auth) throws Exception{ auth .inMemoryAuthentication() .withUser("tom") .password("password") .roles("ADMIN") .and() .withUser("user") .password("password") .roles("USER"); }}
尽管我在内存中定义了用户,但无法使用它们登录,每次运行应用程序时都会生成一个用户密码,我非常确定这不应该发生。
我已经尝试了这里发布的解决方案,但完全没有运气。
application.properties没有任何更改,主应用程序类是默认的,没有更改。