Device authorization
OAuth2 device authorization endpoint.
This endpoint implements the first step of the OAuth2 device authorization grant flow as defined in https://tools.ietf.org/html/rfc8628. It is called to initiate the device authorization flow by requesting a device and user code for a given client ID.
A new OAuth device is created in PENDING state, stored in the DB and returned to the client along with a pair of newly generated device and user codes that are set to expire after a certain time.
The client may pass an existing OAuth device ID, if it has previously ran the device authorization flow before and it was already assigned a device for the same client ID. In this case, the existing device entry is reused and new device and user codes are generated.
Args: request: The request object. client_id: The client ID. device_id: The device ID, if the device is already registered. user_manager: The user manager.
Returns: The device authorization response.
Successful Response
OAuth2 device authorization grant response.
Validation Error
POST /auth/device_authorization HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 103
"client_id='123e4567-e89b-12d3-a456-426614174000'&device_id='123e4567-e89b-12d3-a456-426614174000'"{
"device_code": "text",
"user_code": "text",
"verification_uri": "text",
"verification_uri_complete": "text",
"expires_in": 1,
"interval": 1
}Last updated
Was this helpful?