Verify

Verify Authorized Device

put

Verifies an OAuth2 authorized device using its unique user code.

This endpoint implements the web user authorization step in the OAuth2 device authorization grant flow as defined in https://tools.ietf.org/html/rfc8628. It is called from the dashboard to verify an OAuth device using its user code.

The request is expected to contain at least the user code. Optionally, the trusted device flag can be set to indicate that the device is trusted and will not require a re-verification in the near future. Additionally, the dashboard may set metadata fields to store additional information about the device that will be passed to the client at the end of the device authorization flow (e.g. a default workspace ID to be pre-selected).

If the user code is valid, the device is marked as verified and associated with the user that authorized the device. This association is required to be able to issue access tokens or revoke the device later on. The user code is invalidated and cannot be used for further authorizations.

Args: request: The model containing the verification request. user: The authorized user. user_manager: The user manager.

Returns: The updated OAuth2 authorized device object.

Authorizations
OAuth2clientCredentialsRequired
Token URL:

OAuth2authorizationCodeRequired
Authorization URL: Token URL: Refresh URL:
Body

OAuth2 device authorization verification request.

user_codestringRequired
trusted_devicebooleanOptionalDefault: false
device_metadataany ofOptional
or
nullOptional
Responses
chevron-right
200

Successful Response

application/json

Response body for OAuth2 devices.

idstring · uuidRequired

The OAuth2 device ID.

nameany ofOptional

The name of the OAuth2 device.

stringOptional
or
nullOptional
createdstring · date-timeRequired

The creation date of the OAuth2 device.

updatedstring · date-timeRequired

The date the OAuth2 device was last updated.

user_idany ofOptional

The user ID owning the OAuth2 device.

string · uuidOptional
or
nullOptional
client_idstring · uuidRequired

The client ID of the OAuth2 device.

expiresstring · date-timeRequired

The expiration date of the OAuth2 device after which the device can no longer be used in the OAuth2 authorized device flow.

trusted_devicebooleanRequired

Whether the OAuth2 device was marked as trusted. A trusted device has a much longer validity time.

statusstring · enumRequired

The status of the OAuth2 device.

Possible values:
osany ofOptional

The operating system of the device used for authentication.

stringOptional
or
nullOptional
ip_addressany ofOptional

The IP address of the device used for authentication.

stringOptional
or
nullOptional
hostnameany ofOptional

The hostname of the device used for authentication.

stringOptional
or
nullOptional
cityany ofOptional

The city where the device is located.

stringOptional
or
nullOptional
regionany ofOptional

The region where the device is located.

stringOptional
or
nullOptional
countryany ofOptional

The country where the device is located.

stringOptional
or
nullOptional
last_loginany ofOptional

The date of the last successful login.

string · date-timeOptional
or
nullOptional
put
/devices/verify
ZenML Scarf

Last updated

Was this helpful?