我正在使用带有Spring安全性的Springboot。在以下配置下,
http.csrf()
.disable().authorizeRequests()
.antMatchers(HttpMethod.POST, "/myHome").authenticated();
我可以通过在 POSTMAN 中添加基本身份验证标头来访问我的主页。
但是访问 with URL 会给出 401。
http://testUser:testPassword@localhost:8080/myHome
我错过了什么吗?
Spring Security的基本身份验证要求username:password
标头中的Base64编码字符串。
Base64.encode("username:password");
使用http://user:password@domain/
并不安全。