|
@@ -6,6 +6,7 @@ import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
import org.springframework.core.io.Resource;
|
|
|
+import org.springframework.security.jwt.crypto.sign.RsaVerifier;
|
|
|
import org.springframework.security.oauth2.provider.token.TokenStore;
|
|
|
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
|
|
|
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
|
|
@@ -42,6 +43,8 @@ public class JwtConfigurer {
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
|
converter.setVerifierKey(publicKey);
|
|
|
+ //不设置这个会出现 Cannot convert access token to JSON
|
|
|
+ converter.setVerifier(new RsaVerifier(publicKey));
|
|
|
converter.setAccessTokenConverter(customAccessTokenConverter);
|
|
|
return converter;
|
|
|
}
|