protected OidcIdToken generateIdToken(final OAuth20AccessTokenResponseResult result,
                                          final OAuth20AccessToken accessToken) {
        return FunctionUtils.doUnchecked(() -> {
            val refreshToken = result.getGeneratedToken().getRefreshToken().orElse(null);
            var idTokenContext = IdTokenGenerationContext
                .builder()
                .accessToken(accessToken)
                .userProfile(result.getUserProfile())
                .responseType(result.getResponseType())
                .grantType(result.getGrantType())
                .registeredService((OAuthRegisteredService) result.getRegisteredService())
                .refreshToken(resolveToken(refreshToken, OAuth20RefreshToken.class))
                .build();
            LOGGER.debug("Generating ID token for access token [{}]", accessToken.getId());
            return configurationContext.getObject().getIdTokenGeneratorService().generate(idTokenContext);
        });
    }
This is {@link OidcAccessTokenResponseGenerator}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/web/OidcAccessTokenResponseGenerator.java