@Override
    public OAuth20AccessToken create(final Service service,
                                     final Authentication authentication,
                                     final Ticket ticketGrantingTicket,
                                     final Collection<String> scopes,
                                     final String exchangedToken,
                                     final String clientId,
                                     final Map<String, Map<String, Object>> requestClaims,
                                     final OAuth20ResponseTypes responseType,
                                     final OAuth20GrantTypes grantType) throws Throwable {
        val registeredService = OAuth20Utils.getRegisteredOAuthServiceByClientId(jwtBuilder.getServicesManager(), clientId);
        var limitReached = false;
        if (ticketGrantingTicket != null) {
            val maxNumberOfTokensAllowed = getMaxNumberOfAccessTokensAllowed(registeredService);
            if (maxNumberOfTokensAllowed > 0) {
                limitReached = descendantTicketsTrackingPolicy.countTicketsFor(ticketGrantingTicket, service) >= maxNumberOfTokensAllowed
                    || ticketRegistry.countTicketsFor(service) >= maxNumberOfTokensAllowed;
            }
            FunctionUtils.throwIf(limitReached, () -> new IllegalArgumentException("Access token limit for %s is reached".formatted(service.getId())));
        }
        val expirationPolicyToUse = determineExpirationPolicyForService(registeredService);
        val accessTokenId = generateAccessTokenId(service, authentication);
        val accessToken = new OAuth20DefaultAccessToken(accessTokenId, service, authentication,
            expirationPolicyToUse, ticketGrantingTicket, exchangedToken, scopes,
            clientId, requestClaims, responseType, grantType);
        FunctionUtils.doIfNotNull(service, __ -> accessToken.setTenantId(service.getTenant()));
        descendantTicketsTrackingPolicy.trackTicket(ticketGrantingTicket, accessToken);
        return accessToken;
    }
Default OAuth access token factory.

@author Jerome Leleu
@since 5.0.0
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/ticket/accesstoken/OAuth20DefaultAccessTokenFactory.java