From a9f4e6ef7acc4077e8635c1ecf95c37f085e245d Mon Sep 17 00:00:00 2001 From: "shengzhaoli.shengz" Date: Sat, 23 Oct 2021 12:23:07 +0800 Subject: [PATCH] Update spring-boot 2.4.2 , update config --- .../java/com/monkeyk/sos/config/JWTTokenStoreConfiguration.java | 2 ++ .../com/monkeyk/sos/config/JdbcTokenStoreConfiguration.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main/java/com/monkeyk/sos/config/JWTTokenStoreConfiguration.java b/src/main/java/com/monkeyk/sos/config/JWTTokenStoreConfiguration.java index a01a564..679c02b 100644 --- a/src/main/java/com/monkeyk/sos/config/JWTTokenStoreConfiguration.java +++ b/src/main/java/com/monkeyk/sos/config/JWTTokenStoreConfiguration.java @@ -5,6 +5,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; import org.springframework.security.oauth2.provider.ClientDetailsService; import org.springframework.security.oauth2.provider.token.DefaultAccessTokenConverter; import org.springframework.security.oauth2.provider.token.DefaultTokenServices; @@ -70,6 +71,7 @@ public class JWTTokenStoreConfiguration { @Bean + @Primary public DefaultTokenServices tokenServices(TokenStore tokenStore, JwtAccessTokenConverter tokenEnhancer, ClientDetailsService clientDetailsService) { DefaultTokenServices tokenServices = new DefaultTokenServices(); tokenServices.setTokenStore(tokenStore); diff --git a/src/main/java/com/monkeyk/sos/config/JdbcTokenStoreConfiguration.java b/src/main/java/com/monkeyk/sos/config/JdbcTokenStoreConfiguration.java index 748b8a3..0822a07 100644 --- a/src/main/java/com/monkeyk/sos/config/JdbcTokenStoreConfiguration.java +++ b/src/main/java/com/monkeyk/sos/config/JdbcTokenStoreConfiguration.java @@ -3,6 +3,7 @@ package com.monkeyk.sos.config; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; import org.springframework.security.oauth2.provider.ClientDetailsService; import org.springframework.security.oauth2.provider.token.DefaultTokenServices; import org.springframework.security.oauth2.provider.token.TokenStore; @@ -36,6 +37,7 @@ public class JdbcTokenStoreConfiguration { @Bean + @Primary public DefaultTokenServices tokenServices(TokenStore tokenStore, ClientDetailsService clientDetailsService) { DefaultTokenServices tokenServices = new DefaultTokenServices(); tokenServices.setTokenStore(tokenStore);