Spring oauth2 refresh token - Cannot convert access token to JSON

后端 未结 5 899
长发绾君心
长发绾君心 2021-01-18 03:46

I\'m trying to use a refresh token in a Spring OAuth application without success. The system will issue a refresh token on a password grant:

  {
  \"access_t         


        
5条回答
  •  爱一瞬间的悲伤
    2021-01-18 04:26

    Also has same issue with Spring Boot 1.5.4

    It is really actual that jwtAccessTokenConverter.setVerifierKey(publicKey);doesn't really set verifier(in debug value is null) that is used in -

    JwtAccessTokenConverter
    ...protected Map decode(String token) {
            try {
                Jwt jwt = JwtHelper.decodeAndVerify(token, verifier);
    

    as workaround helped:

    private JwtAccessTokenConverter jwtAccessTokenConverter() {
            JwtAccessTokenConverter jwtAccessTokenConverter = new CustomTokenEnhancer();
            jwtAccessTokenConverter.setSigningKey(jwtSigningKey);
            jwtAccessTokenConverter.setVerifier(new RsaVerifier(jwtPublicKey));
            log.info("Set JWT signing key to: {}", jwtAccessTokenConverter.getKey());
    
            return jwtAccessTokenConverter;
        }
    

提交回复
热议问题