SHARE
TWEET

Untitled

a guest Jul 21st, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top