You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 31, 2022. It is now read-only.
Currently only the validity of the refresh token is exposed for configuration (via ClientDetailsServiceConfigurer), but you can't specify whether to reuse refresh tokens.
Well, you can, with ugly reflection, but it should be prettier:
endpoints.clientDetailsService(detailsService); //autowired detailsService instance
// we need this in order to reuse the private createTokenServices() method to properly populate the default values
Method method = endpoints.getClass().getDeclaredMethod("createTokenServices");
method.setAccessible(true);
DefaultTokenServices defaultService = (DefaultTokenServices) ReflectionUtils.invokeMethod(method, endpoints);
defaultService.setReuseRefreshToken(false);
endpoints.tokenServices(defaultService);
The text was updated successfully, but these errors were encountered:
You can create your own instanceof DefaultTokenServices and set it up however you want (no need for reflection since it has public constructor and methods). It might be useful to expose that boolean property, but I'm not sure the right way to do it is directly on the AuthorizationServerEndpointsConfigurer. It feels like a builder for the token services might be a better abstraction (if you feel like making a contribution).
I guess that's a different definition of "not needed" than I used. Fair enough. A PR would be excellent in any case (please do the contributor's agreement - link in README - if you haven't already).
Currently only the validity of the refresh token is exposed for configuration (via ClientDetailsServiceConfigurer), but you can't specify whether to reuse refresh tokens.
Well, you can, with ugly reflection, but it should be prettier:
The text was updated successfully, but these errors were encountered: