DeviceAuthorization
in package
The `DeviceAuthorizationResponse` — what the device shows its user, plus the `device_code` it polls with (CONTRACT.md §14.1).
$deviceCode is Sensitive (§14.5): a bearer credential for the lifetime of the
grant. $userCode deliberately is not — it exists to be read aloud and typed by a
human, and wrapping it would defeat the one thing it is for. Neither may be logged;
displaying the user code is the caller's job.
Table of Contents
Properties
- $deviceCode : Sensitive
- $expiresIn : int
- $interval : int
- $userCode : string
- $verificationUri : string
- $verificationUriComplete : string|null
Methods
- __construct() : mixed
Properties
$deviceCode read-only
public
Sensitive
$deviceCode
$expiresIn read-only
public
int
$expiresIn
$interval read-only
public
int
$interval
$userCode read-only
public
string
$userCode
$verificationUri read-only
public
string
$verificationUri
$verificationUriComplete read-only
public
string|null
$verificationUriComplete
Methods
__construct()
public
__construct(Sensitive $deviceCode, string $userCode, string $verificationUri, string|null $verificationUriComplete, int $expiresIn, int $interval) : mixed
Parameters
- $deviceCode : Sensitive
-
The device's polling credential (§14.5 secret).
- $userCode : string
-
The short code the human types into the verification page.
- $verificationUri : string
-
Where the human goes to enter
$userCode. - $verificationUriComplete : string|null
-
The verification URI with the user code already embedded, when the server sent one — prefer it when the device can render a QR code. Never synthesised by concatenation when absent (§14.3): its format is the server's to choose.
- $expiresIn : int
-
Seconds until the grant expires. Polling stops here (§14.2 rule 4).
- $interval : int
-
Seconds between polls, from the response, defaulted to 5 when the server omitted it (§14.2 rule 2).