Class OidcDeviceAuthorization
java.lang.Object
com.codename1.io.oidc.OidcDeviceAuthorization
What an authorization server answers when a device starts the device authorization grant (RFC 8628): the code the user types, where they type it, and how the device waits.
Obtained from OidcClient.requestDeviceAuthorization(). Show getUserCode() and
getVerificationUri() to the user -- or getVerificationUriComplete() as a QR code, which
carries the code with it -- and hand this object to
OidcClient.pollDeviceToken(OidcDeviceAuthorization).
-
Method Summary
Modifier and TypeMethodDescriptionstatic OidcDeviceAuthorizationBuilds one from a parsed device authorization response.The code the device polls with.When the codes stop being valid.intThe least number of seconds the device waits between two polls.The short code the user types on the verification page.The page the user opens on another device to type the code.The same page with the code already in it, for a QR code.booleanWhether the codes have run out.
-
Method Details
-
fromJson
Builds one from a parsed device authorization response.
Parameters
json: the response, parsed
Returns
the authorization
Throws
IllegalArgumentException: when the response has nodevice_code, nouser_codeor no verification address, orexpires_inis not a nonnegative integer that can be represented as an expiry time, or a suppliedintervalis not a positive integer that fits the polling timer
-
getDeviceCode
The code the device polls with. Not for the user's eyes. -
getUserCode
The short code the user types on the verification page. -
getVerificationUri
The page the user opens on another device to type the code. -
getVerificationUriComplete
The same page with the code already in it, for a QR code.
Returns
the URI, or null when the server did not supply one
-
getExpiresAt
When the codes stop being valid.
Returns
the moment computed from the required
expires_inresponse value -
isExpired
public boolean isExpired()Whether the codes have run out. -
getInterval
public int getInterval()The least number of seconds the device waits between two polls.
-