private OAuth20DeviceToken getDeviceTokenFromTicketRegistry(final String deviceCode) {
        return FunctionUtils.doAndHandle(
                () -> ticketRegistry.getTicket(deviceCode, OAuth20DeviceToken.class),
                throwable -> {
                    LoggingUtils.error(LOGGER, throwable);
                    throw new InvalidOAuth20DeviceTokenException(deviceCode);
                })
            .get();
    }
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