Java Code Examples for org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore#setPrefix()

The following examples show how to use org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore#setPrefix() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SophiaResourceServerConfig.java    From sophia_scaffolding with Apache License 2.0 5 votes vote down vote up
/**
     * token store
     */
    @Bean
    public TokenStore tokenStore() {
//        return new InMemoryTokenStore();
        RedisTokenStore redisTokenStore = new RedisTokenStore(redisConnectionFactory);
        redisTokenStore.setPrefix(GlobalsConstants.PROJECT_PREFIX+GlobalsConstants.OAUTH_PREFIX);
        return redisTokenStore;
//        return new JwtTokenStore(jwtAccessTokenConverter());
//        return new JdbcTokenStore(dataSource);
    }
 
Example 2
Source File: SophiaAuthorizationServerConfig.java    From sophia_scaffolding with Apache License 2.0 5 votes vote down vote up
/**
 * token store
 */
@Bean
public TokenStore tokenStore() {
    RedisTokenStore redisTokenStore = new RedisTokenStore(connectionFactory);
    redisTokenStore.setPrefix(GlobalsConstants.PROJECT_PREFIX+ GlobalsConstants.OAUTH_PREFIX);
    return redisTokenStore;
           // return new JwtTokenStore(accessTokenConverter());
}
 
Example 3
Source File: SophiaResourceServerConfig.java    From sophia_scaffolding with Apache License 2.0 5 votes vote down vote up
/**
     * token store
     */
    @Bean
    public TokenStore tokenStore() {
//        return new InMemoryTokenStore();
        RedisTokenStore redisTokenStore = new RedisTokenStore(redisConnectionFactory);
        redisTokenStore.setPrefix(GlobalsConstants.PROJECT_PREFIX+GlobalsConstants.OAUTH_PREFIX);
        return redisTokenStore;
//        return new JwtTokenStore(jwtAccessTokenConverter());
//        return new JdbcTokenStore(dataSource);
    }
 
Example 4
Source File: SophiaAuthorizationServerConfig.java    From sophia_scaffolding with Apache License 2.0 5 votes vote down vote up
/**
 * token store
 */
@Bean
public TokenStore tokenStore() {
    RedisTokenStore redisTokenStore = new RedisTokenStore(connectionFactory);
    redisTokenStore.setPrefix(GlobalsConstants.PROJECT_PREFIX+GlobalsConstants.OAUTH_PREFIX);
    return redisTokenStore;
           // return new JwtTokenStore(accessTokenConverter());
}
 
Example 5
Source File: FwAuthorizationConfiguration.java    From fw-cloud-framework with MIT License 5 votes vote down vote up
/**
 * tokenstore 定制化处理 1. 如果使用的 redis-cluster 模式请使用 FwRedisTokenStore FwRedisTokenStore tokenStore = new
 * FwRedisTokenStore();
 * tokenStore.setRedisTemplate(redisTemplate);
 */
@Bean
public TokenStore redisTokenStore() {
	RedisTokenStore tokenStore = new RedisTokenStore(redisConnectionFactory);
	tokenStore.setPrefix(SecurityConstant.PREFIX);
	return tokenStore;
}
 
Example 6
Source File: PigAuthorizationConfig.java    From pig with MIT License 3 votes vote down vote up
/**
 * tokenstore 定制化处理
 *
 * @return TokenStore
 * 1. 如果使用的 redis-cluster 模式请使用 PigRedisTokenStore
 * PigRedisTokenStore tokenStore = new PigRedisTokenStore();
 * tokenStore.setRedisTemplate(redisTemplate);
 */
@Bean
public TokenStore redisTokenStore() {
    RedisTokenStore tokenStore = new RedisTokenStore(redisConnectionFactory);
    tokenStore.setPrefix(SecurityConstants.PIG_PREFIX);
    return tokenStore;
}