请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

Unsupported grant type: password问题

@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);

}

}
这是配置了密码模式吗,为什么会这样啊

正在回答 回答被采纳积分+3

1回答

JoJo 2019-11-05 09:51:40

这是因为你没配AuthenticationManager,看一下WebSecurityConfigurerAdapter中authenticationManagerBean方法的javadoc,然后照着做一下就好了。

0 回复 有任何疑惑可以回复我~
  • 提问者 iemi #1
    你在视频里面也没配啊,是因为版本问题吗
    回复 有任何疑惑可以回复我~ 2019-11-05 09:53:14
  • JoJo 回复 提问者 iemi #2
    有可能,你用的什么版本?
    回复 有任何疑惑可以回复我~ 2019-11-05 16:08:00
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号