环境说明
我使用的是Spring Cloud OAuth2, 并使用的Redis做的token存储方案, 实现了使用 access_token 每次访问系统接口的时候刷新token的过期时间
另外这只是我自己个人琢磨的一套方案, 如果有大神有什么想法欢迎指教
如果有其他token存储方案的应该也类似, 不说了直接上代码
自定义TokenStoreService
public class MyRedisTokenStoreService extends RedisTokenStore {
private ClientDetailsService clientDetailsService;
public MyRedisTokenStoreService(RedisConnectionFactory connectionFactory, ClientDetailsService clientDetailsService) {
super(connectionFactory);
<