use of org.springframework.security.oauth2.provider.token.TokenEnhancerChain in project paascloud-master by paascloud.
the class PcAuthorizationServerConfig method configure.
/**
* Configure.
*
* @param endpoints the endpoints
*
* @throws Exception the exception
*/
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
endpoints.tokenStore(tokenStore).authenticationManager(authenticationManager).userDetailsService(userDetailsService);
if (jwtAccessTokenConverter != null && jwtTokenEnhancer != null) {
TokenEnhancerChain enhancerChain = new TokenEnhancerChain();
List<TokenEnhancer> enhancers = new ArrayList<>();
enhancers.add(jwtTokenEnhancer);
enhancers.add(jwtAccessTokenConverter);
enhancerChain.setTokenEnhancers(enhancers);
endpoints.tokenEnhancer(enhancerChain).accessTokenConverter(jwtAccessTokenConverter);
}
}
use of org.springframework.security.oauth2.provider.token.TokenEnhancerChain in project flytecnologia-api by jullierme.
the class FlyAutorizationServerConfig method configure.
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {
TokenEnhancerChain tokenEnhancerChain = new TokenEnhancerChain();
tokenEnhancerChain.setTokenEnhancers(Arrays.asList(tokenEnhancer(), jwtAccessTokenConverter));
endpoints.tokenStore(tokenStore()).tokenEnhancer(tokenEnhancerChain).authenticationManager(authenticationManager).accessTokenConverter(jwtAccessTokenConverter).reuseRefreshTokens(false);
/* endpoints
.tokenStore(tokenStore())
.accessTokenConverter(jwtAccessTokenConverter)
.reuseRefreshTokens(false)
.authenticationManager(authenticationManager);*/
}
use of org.springframework.security.oauth2.provider.token.TokenEnhancerChain 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