我对Security 5基本身份验证有问题。我将Spring配置如下:
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
// auth.inMemoryAuthentication().withUser("user").password("{noop}password").roles("ADMIN");
auth.inMemoryAuthentication().withUser("user").password("{sha256}5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8").roles("ADMIN");
}
}所有东西都与{noop}密码编码器(注释代码)一起工作得很好--我能够使用报头进行身份验证:授权: Basic dXNlcjpwYXNzd29yZA==。但是当我提供sha256编码的密码(未注释的代码)时,我总是得到:org.springframework.security.authentication.BadCredentialsException: Bad credentials
发布于 2022-05-03 14:49:28
试一试
{SHA-256}而不是
{SHA256}https://stackoverflow.com/questions/70040066
复制相似问题