Comment redis support config
parent
077f1965e6
commit
ce5e7f93be
8
pom.xml
8
pom.xml
|
@ -67,10 +67,10 @@
|
|||
</dependency>
|
||||
|
||||
<!--Redis-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
<!--<dependency>-->
|
||||
<!--<groupId>org.springframework.boot</groupId>-->
|
||||
<!--<artifactId>spring-boot-starter-data-redis</artifactId>-->
|
||||
<!--</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
|
|
|
@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
|
@ -28,7 +27,7 @@ import org.springframework.security.oauth2.provider.code.AuthorizationCodeServic
|
|||
import org.springframework.security.oauth2.provider.code.JdbcAuthorizationCodeServices;
|
||||
import org.springframework.security.oauth2.provider.request.DefaultOAuth2RequestFactory;
|
||||
import org.springframework.security.oauth2.provider.token.TokenStore;
|
||||
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;
|
||||
import org.springframework.security.oauth2.provider.token.store.JdbcTokenStore;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
|
@ -140,21 +139,21 @@ public class OAuth2ServerConfiguration {
|
|||
/*
|
||||
* JDBC TokenStore
|
||||
*/
|
||||
// @Bean
|
||||
// public TokenStore tokenStore(DataSource dataSource) {
|
||||
// return new JdbcTokenStore(dataSource);
|
||||
// }
|
||||
@Bean
|
||||
public TokenStore tokenStore(DataSource dataSource) {
|
||||
return new JdbcTokenStore(dataSource);
|
||||
}
|
||||
|
||||
/*
|
||||
* Redis TokenStore
|
||||
*/
|
||||
@Bean
|
||||
public TokenStore tokenStore(RedisConnectionFactory connectionFactory) {
|
||||
final RedisTokenStore redisTokenStore = new RedisTokenStore(connectionFactory);
|
||||
//prefix
|
||||
redisTokenStore.setPrefix(RESOURCE_ID);
|
||||
return redisTokenStore;
|
||||
}
|
||||
// @Bean
|
||||
// public TokenStore tokenStore(RedisConnectionFactory connectionFactory) {
|
||||
// final RedisTokenStore redisTokenStore = new RedisTokenStore(connectionFactory);
|
||||
// //prefix
|
||||
// redisTokenStore.setPrefix(RESOURCE_ID);
|
||||
// return redisTokenStore;
|
||||
// }
|
||||
|
||||
|
||||
@Bean
|
||||
|
|
|
@ -32,10 +32,10 @@ spring.jmx.enabled=false
|
|||
#
|
||||
# Redis
|
||||
#
|
||||
spring.redis.host=localhost
|
||||
spring.redis.port=6379
|
||||
spring.redis.database=0
|
||||
spring.redis.password=
|
||||
#spring.redis.host=localhost
|
||||
#spring.redis.port=6379
|
||||
#spring.redis.database=0
|
||||
#spring.redis.password=
|
||||
#spring.redis.timeout=2000
|
||||
#spring.redis.ssl=false
|
||||
|
||||
|
|
Loading…
Reference in New Issue