jobmission / oauth2-server

spring boot (springboot 3+) oauth2 server sso 单点登录 认证中心 JWT,独立部署,用户管理 客户端管理
MIT License
488 stars 222 forks source link

[invalid_grant] Invalid authorization code: YX2sZk #6

Closed jerry20198888 closed 5 years ago

jerry20198888 commented 5 years ago

更新最新代码后 client 无法正常验证 Login with OAuth 2.0 [invalid_grant] Invalid authorization code: YX2sZk

jobmission commented 5 years ago

感谢反馈,问题已解决,请更新代码

jerry20198888 commented 5 years ago

用 tokenGranter() 还是有问题呀

@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
    // 注入authenticationManager来支持password模式
    endpoints.authenticationManager(authenticationManager);
    endpoints.accessTokenConverter(accessTokenConverter());
    endpoints.tokenStore(tokenStore());
    // !!!要使用refresh_token的话,需要额外配置userDetailsService!!!
    endpoints.userDetailsService(userDetailsService);
    endpoints.reuseRefreshTokens(true);

    `**//endpoints.tokenGranter(tokenGranter());   // ************* tokenGranter()     Invalid authorization code**`

    endpoints.tokenEnhancer(tokenEnhancer());   // 设了 tokenGranter 后该配制失效,需要在 tokenServices() 中设置
    endpoints.userApprovalHandler(userApprovalHandler());

}
jobmission commented 5 years ago

刚又测试没有问题的,能把错误日志粘贴一下吗

jerry20198888 commented 5 years ago

更新代码后,问题已解决,(上次只更新到spingboot版本升级到2.1.4 )谢谢.