spring-security-oauth2 2.0.7 refresh token UserDetailsService Configuration - UserDetailsService is required

前端 未结 3 1226
故里飘歌
故里飘歌 2021-01-02 08:50

I would have one question regarding the configuration of spring-security-oauth2 2.0.7 please. I am doing the Authentication using LDAP via a GlobalAuthenticationConfigurerAd

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-02 09:36

    I had a similar issue when I was implementing a a OAuth2 server with JWT tokens with a custom AuthenticationProvider instead of a UserDetailsService implementation to solve login authentications.

    But lately I found that the error Spring raises is correct if you want the refresh_token working correctly. For an AuthenticationProvider implementation is impossible to refresh a token with a refresh_token, because in that kind of implementation you have to resolve if the password is correct, but the refresh token doesn't have that information. However, UserDetailsService is agnostic of the password.

    The version 2.0.6 of spring-security-oauth2 works because never checks the user grants, just checks if the refresh token is valid (signed with the private key), but, if the user was deleted from the system after a first login, with a refresh token the deleted user will have infinite time access to your system, that is a big security issue.

    Take a look to the issue I reported with this: https://github.com/spring-projects/spring-security-oauth/issues/813

提交回复
热议问题