use of org.motechproject.mots.security.token.CustomTokenServices in project mots by motech-implementations.
the class TokenConfiguration method tokenServices.
/**
* Set-up CustomTokenServices with tokenStore().
* @return token services
*/
@Bean
@Primary
public CustomTokenServices tokenServices() {
TokenEnhancerChain tokenEnhancerChain = new TokenEnhancerChain();
tokenEnhancerChain.setTokenEnhancers(Arrays.asList(tokenEnhancer(), accessTokenConverter()));
CustomTokenServices customTokenServices = new CustomTokenServices();
customTokenServices.setTokenStore(tokenStore());
customTokenServices.setTokenEnhancer(tokenEnhancerChain);
customTokenServices.setClientDetailsService(clientDetailsService);
customTokenServices.setSupportRefreshToken(true);
customTokenServices.setAccessTokenValiditySeconds(tokenValiditySeconds);
customTokenServices.setRefreshTokenValiditySeconds(tokenValiditySeconds * 2);
customTokenServices.setReuseRefreshToken(false);
return customTokenServices;
}
Aggregations