In file JWTOAuth2Config.java shouldn't the configure function also have endpoints.tokenServices(tokenServices) ? tokenServices is autowired in this file but never used? When I add it myself I lose the JWT token and start getting the original oauth uid token again.
`
@Override
public void configure(AuthorizationServerEndpointsConfigurer endpoints) {
TokenEnhancerChain tokenEnhancerChain = new TokenEnhancerChain();
tokenEnhancerChain.setTokenEnhancers(Arrays.asList(jwtTokenEnhancer, jwtAccessTokenConverter));
endpoints.tokenStore(tokenStore)
.accessTokenConverter(jwtAccessTokenConverter)
.tokenEnhancer(tokenEnhancerChain)
.tokenServices(tokenServices) // I added this
.authenticationManager(authenticationManager)
.userDetailsService(userDetailsService);
}
`
I am confused how the DefaultTokenServices work because I added defaultTokenServices.setAccessTokenValiditySeconds(7200); and its not working. So I am confused how tokenServices even work in this setup?
`
@Bean
@Primary
public DefaultTokenServices tokenServices() {
DefaultTokenServices defaultTokenServices = new DefaultTokenServices();
defaultTokenServices.setTokenStore(tokenStore());
defaultTokenServices.setAccessTokenValiditySeconds(7200); // I added this
defaultTokenServices.setSupportRefreshToken(true);
return defaultTokenServices;
}
In file JWTOAuth2Config.java shouldn't the configure function also have endpoints.tokenServices(tokenServices) ? tokenServices is autowired in this file but never used? When I add it myself I lose the JWT token and start getting the original oauth uid token again.
` @Override public void configure(AuthorizationServerEndpointsConfigurer endpoints) { TokenEnhancerChain tokenEnhancerChain = new TokenEnhancerChain(); tokenEnhancerChain.setTokenEnhancers(Arrays.asList(jwtTokenEnhancer, jwtAccessTokenConverter));
`
I am confused how the DefaultTokenServices work because I added defaultTokenServices.setAccessTokenValiditySeconds(7200); and its not working. So I am confused how tokenServices even work in this setup?
`
@Bean @Primary public DefaultTokenServices tokenServices() { DefaultTokenServices defaultTokenServices = new DefaultTokenServices();
`