@Override
    public OAuth20DeviceUserCode createDeviceUserCode(final String id, final Service service) {
        val userCode = StringUtils.defaultIfBlank(id, normalizeUserCode(RandomUtils.randomAlphanumeric(userCodeLength)));
        val expirationPolicyToUse = OAuth20DeviceTokenUtils.determineExpirationPolicyForService(servicesManager, expirationPolicyBuilder, service);
        val duc = new OAuth20DefaultDeviceUserCode(normalizeUserCode(userCode), service, expirationPolicyToUse);
        FunctionUtils.doIfNotNull(service, __ -> duc.setTenantId(service.getTenant()));
        return duc;
    }
Default OAuth device token factory.

@author Misagh Moayyed
@since 6.0.0
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/ticket/device/OAuth20DefaultDeviceUserCodeFactory.java