Unsupported grant type: password问题
来源:6-2 实现标准的OAuth服务提供商

iemi
2019-11-05
@Configuration
@EnableAuthorizationServer
public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter{
// @Autowired
private PasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
clients.inMemory()
.withClient("client1")
.secret(passwordEncoder.encode("123"))
.redirectUris("http://example.com")
.scopes("all")
.authorizedGrantTypes("authorization_code", "refresh_token", "password");
// .autoApprove(false);
}
}
这是配置了密码模式吗,为什么会这样啊
写回答
1回答
-
JoJo
2019-11-05
这是因为你没配AuthenticationManager,看一下WebSecurityConfigurerAdapter中authenticationManagerBean方法的javadoc,然后照着做一下就好了。
022019-11-05
Spring Security技术栈开发企业级认证与授权
Spring Security技术栈,REST风格开发常见接口,独立开发认证授权模块保证REST服务安全
2662 学习 · 1561 问题
相似问题