Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import org.springframework.beans.factory.annotation.Value;
  2. import org.springframework.context.annotation.Bean;
  3. import org.springframework.context.annotation.Configuration;
  4. import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
  5. import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
  6.  
  7. @Configuration
  8. public class JwtTokenConfiguration {
  9.  
  10. @Value("${api-security.jwt.signing-key}")
  11. private String signingKey;
  12.  
  13. @Bean
  14. public JwtAccessTokenConverter accessTokenConverter() {
  15. final JwtAccessTokenConverter converter = new JwtAccessTokenConverter();
  16. converter.setSigningKey(signingKey);
  17. return converter;
  18. }
  19.  
  20. @Bean
  21. public JwtTokenStore tokenStore(final JwtAccessTokenConverter converter) {
  22. return new JwtTokenStore(converter);
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement