Search in sources :

Example 11 with TokenEnhancer

use of org.springframework.security.oauth2.provider.token.TokenEnhancer in project Spring-5.0-By-Example by PacktPublishing.

the class OAuthTokenProducer method tokenEnhancer.

@Bean
public JwtAccessTokenConverter tokenEnhancer() {
    JwtAccessTokenConverter converter = new JwtAccessTokenConverter();
    converter.setSigningKey(privateKey);
    converter.setVerifierKey(publicKey);
    return converter;
}
Also used : JwtAccessTokenConverter(org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter) Bean(org.springframework.context.annotation.Bean)

Aggregations

Test (org.junit.Test)4 OAuth2AccessToken (org.springframework.security.oauth2.common.OAuth2AccessToken)4 OAuth2Authentication (org.springframework.security.oauth2.provider.OAuth2Authentication)4 Bean (org.springframework.context.annotation.Bean)3 DefaultOAuth2AccessToken (org.springframework.security.oauth2.common.DefaultOAuth2AccessToken)3 TokenEnhancerChain (org.springframework.security.oauth2.provider.token.TokenEnhancerChain)3 Primary (org.springframework.context.annotation.Primary)2 DefaultExpiringOAuth2RefreshToken (org.springframework.security.oauth2.common.DefaultExpiringOAuth2RefreshToken)2 ExpiringOAuth2RefreshToken (org.springframework.security.oauth2.common.ExpiringOAuth2RefreshToken)2 TokenRequest (org.springframework.security.oauth2.provider.TokenRequest)2 DefaultTokenServices (org.springframework.security.oauth2.provider.token.DefaultTokenServices)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 Before (org.junit.Before)1 CustomTokenServices (org.motechproject.mots.security.token.CustomTokenServices)1 InMemoryClientDetailsServiceBuilder (org.springframework.security.oauth2.config.annotation.builders.InMemoryClientDetailsServiceBuilder)1 TokenEnhancer (org.springframework.security.oauth2.provider.token.TokenEnhancer)1 JwtAccessTokenConverter (org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter)1 JwtTokenStore (org.springframework.security.oauth2.provider.token.store.JwtTokenStore)1