Skip to content
This repository has been archived by the owner on May 31, 2022. It is now read-only.

Commit

Permalink
Add convenience method for reuseRefreshToken()
Browse files Browse the repository at this point in the history
Longer term (2.1.0) we should pull out the toke service builing into
a separate builder. It's too big a change for a point release though.

Fixes gh-318
  • Loading branch information
Dave Syer committed Dec 16, 2014
1 parent dd1ba7c commit 793ebe0
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -107,6 +107,8 @@ public final class AuthorizationServerEndpointsConfigurer {

private boolean tokenServicesOverride = false;

private boolean reuseRefreshToken;

public AuthorizationServerTokenServices getTokenServices() {
return tokenServices;
}
Expand Down Expand Up @@ -153,6 +155,11 @@ public AuthorizationServerEndpointsConfigurer tokenEnhancer(TokenEnhancer tokenE
return this;
}

public AuthorizationServerEndpointsConfigurer reuseRefreshTokens() {

This comment has been minimized.

Copy link
@jonas-grgt

jonas-grgt Jan 7, 2015

The DefaultTokenServices has reuseRefreshToken by default set to true.
I don't see what this method adds ?
Shouldn't it accept a boolean and set reuseRefreshToken accordingly ?

public AuthorizationServerEndpointsConfigurer reuseRefreshTokens(boolean reuse)

this.reuseRefreshToken = true;
return this;
}

public AuthorizationServerEndpointsConfigurer accessTokenConverter(AccessTokenConverter accessTokenConverter) {
this.accessTokenConverter = accessTokenConverter;
return this;
Expand Down Expand Up @@ -307,6 +314,7 @@ private DefaultTokenServices createDefaultTokenServices() {
DefaultTokenServices tokenServices = new DefaultTokenServices();
tokenServices.setTokenStore(tokenStore());
tokenServices.setSupportRefreshToken(true);
tokenServices.setReuseRefreshToken(reuseRefreshToken);
tokenServices.setClientDetailsService(clientDetailsService());
tokenServices.setTokenEnhancer(tokenEnhancer());
return tokenServices;
Expand Down

1 comment on commit 793ebe0

@dsyer
Copy link
Contributor

@dsyer dsyer commented on 793ebe0 Jan 7, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See issue #351

Please sign in to comment.