OidcDeviceClient

OAuth 2.0 Device Authorization Grant client (RFC 8628).

This client handles the requesting-device side of the Device Authorization flow:

  1. Requests a device code from the authorization server.

  2. Polls the token endpoint until the user approves, the code expires, or an error occurs.

  3. Optionally opens the verification URI in a browser tab for the user's convenience.

Constructors

Link copied to clipboard
constructor(config: OidcClientConfig)

Functions

Link copied to clipboard
suspend fun authorize(verificationUriComplete: String)

Opens verificationUriComplete in a browser tab (Custom Tab / Auth Tab) so the user can approve the device authorization request.

Link copied to clipboard

Starts the device authorization flow and polls for the token.

Link copied to clipboard
suspend fun user(): User?

Returns the authenticated User if a valid token is present in storage, or null otherwise.