Hi all,
With CAS we have oauth2 services which are registered for multiple grant types. In our case client credentials, refresh token and authorization code. But we only want to allow refresh tokens for authorization code and NOT for client credentials.
Is there a configuration option to restrict refresh tokens to certain grant types? Because I couldn't find one we extended
OAuth20DefaultTokenGenerator:
@Override
protected Pair<OAuth20AccessToken, OAuth20RefreshToken> generateAccessTokenOAuthGrantTypes(AccessTokenRequestDataHolder holder) {
Pair<OAuth20AccessToken, OAuth20RefreshToken> accessTokens = super.generateAccessTokenOAuthGrantTypes(holder);
if (OAuth20GrantTypes.CLIENT_CREDENTIALS.equals(holder.getGrantType())) {
return Pair.of(accessTokens.getLeft(), null);
}
return accessTokens;
}
Does it make sense to introduce some configuration option for this? If so I would try to create a PR for this change.