protected Ticket addAccessToken(final AccessTokenRequestContext tokenRequestContext,
                                    final OAuth20AccessToken accessToken) throws Exception {
        var finalAccessToken = (Ticket) accessToken;
        if (tokenRequestContext.getResponseType() != OAuth20ResponseTypes.ID_TOKEN && accessToken.getExpiresIn() > 0) {
            LOGGER.debug("Created access token [{}]", accessToken);
            finalAccessToken = addTicketToRegistry(accessToken, tokenRequestContext.getTicketGrantingTicket());
            LOGGER.debug("Added access token [{}] to registry", finalAccessToken);
            updateRefreshToken(tokenRequestContext, finalAccessToken);
        }
        updateOAuthCode(tokenRequestContext);
        return finalAccessToken;
    }
This is {@link OAuth20DefaultTokenGenerator}.

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