@Override
    protected Map<String, Object> getAccessTokenResponseModel(final OAuth20AccessTokenResponseResult result) {
        val accessToken = result.getGeneratedToken().getAccessToken();
        val model = super.getAccessTokenResponseModel(result);

        if (result.getGrantType() == OAuth20GrantTypes.TOKEN_EXCHANGE) {
            buildResponseModelForTokenExchange(result, model);
        } else {
            accessToken.map(at -> resolveToken(at, OAuth20AccessToken.class))
                .ifPresent(token -> {
                    if (result.getRegisteredService() instanceof OidcRegisteredService
                        && !token.getScopes().contains(OidcConstants.CLIENT_REGISTRATION_SCOPE)) {
                        collectIdToken(result, token, model);
                    }
                });
        }
        return model;
    }
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