Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
{
  "device_code": "<device_code>",
  "user_code": "<user_code>",
  "verification_uri": "https://example.com/device",
  "verification_uri_complete": "https://example.com/device?user_code=<user_code>",
  "expires_in": 1800,
  "interval": 5
}
  1. The client device (app) periodically polls the token endpoint to check if the user has completed the authorization process. The client uses the device code to poll and the polling interval to prevent excessive requests.

    Code Block
    POST /oauth/v2/token HTTP/1.1
    Host: <EID Server>
    Content-Type: application/x-www-form-urlencoded
    Cache-Control: no-cache
    
    client_id={The Client ID of the OAuth app you registered in EmpowerID}
    &client_secret={The Client Secret of the OAuth app you registered in EmpowerID}
    &grant_type=device_code
    &device_code={The Device Code received in the Authorization Request}
  2. The authorization server responds with either a pending status, an error (if the user has not authorized within the expiry time), or the access token (if the user successfully authorizes).
    Authorization Pending

    Code Block
    HTTP/1.1 400 BadRequest
    {
      "error": "authorization_pending",
      "error_description": "Authorization is currently pending. Please try again after a minimum interval of 5 seconds"
    }

...