| 123456789101112131415161718192021222324252627282930313233 |
- package com.artist.config;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.context.annotation.Bean;
- import org.springframework.context.annotation.Configuration;
- 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;
- /**
- * @author Administrator
- * @version 1.0
- **/
- @Configuration
- public class TokenConfig {
- String SIGNING_KEY = "wy_music_token";
- @Autowired
- private JwtAccessTokenConverter accessTokenConverter;
- @Bean
- public TokenStore tokenStore() {
- return new JwtTokenStore(accessTokenConverter());
- }
- @Bean
- public JwtAccessTokenConverter accessTokenConverter() {
- JwtAccessTokenConverter converter = new JwtAccessTokenConverter();
- converter.setSigningKey(SIGNING_KEY);
- return converter;
- }
- }
|