@Override
    public OAuth20DeviceToken createDeviceCode(final Service service) throws Throwable {
        val codeId = deviceTokenIdGenerator.getNewTicketId(OAuth20DeviceToken.PREFIX);
        val expirationPolicyToUse = OAuth20DeviceTokenUtils.determineExpirationPolicyForService(servicesManager, expirationPolicyBuilder, service);
        val token = new OAuth20DefaultDeviceToken(codeId, service, expirationPolicyToUse);
        FunctionUtils.doIfNotNull(service, __ -> token.setTenantId(service.getTenant()));
        return token;
    }
Default instance for the ticket id generator.
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/ticket/device/OAuth20DefaultDeviceTokenFactory.java