@Override
    protected AccessTokenRequestContext extractInternal(
        final WebContext context, final AccessTokenRequestContext accessTokenRequestContext) {

        val registeredService = getOAuthRegisteredServiceBy(context);
        if (registeredService == null) {
            throw UnauthorizedServiceException.denied("Unable to locate service in registry");
        }
        val shouldRenewRefreshToken = registeredService.isGenerateRefreshToken() && registeredService.isRenewRefreshToken();
        return super.extractInternal(context, accessTokenRequestContext
            .withGenerateRefreshToken(shouldRenewRefreshToken)
            .withExpireOldRefreshToken(shouldRenewRefreshToken));
    }
This is {@link AccessTokenRefreshTokenGrantRequestExtractor}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/response/accesstoken/ext/AccessTokenRefreshTokenGrantRequestExtractor.java