/device_authorization
Start the device authorization flow.
Endpoint
- Method:
POST - URL:
https://sso.user.m7.org/device_authorization - Content type:
application/x-www-form-urlencoded - Response: JSON
When to use it
Use this when your app needs the user to approve access on a separate browser or device.
Typical flow:
- Call
/device_authorization - Show the user the returned
user_codeorverification_uri_complete - The user approves on
/device_login - Your app redeems
device_codeat/token
Client authentication
Authenticate the client according to its configured token endpoint auth method.
Public clients:
- send
client_id - do not send a secret
Confidential clients:
- use
client_secret_basicorclient_secret_post
Request fields
client_idrequiredscopeoptionalaudoptional This may be sent once or repeatednonceoptionalfingerprintoptionalaccess_expiresoptionalrefresh_expiresoptionalclaimsoptionalaccess_claimsoptionalrefresh_claimsoptional
Example
curl -sS https://sso.user.m7.org/device_authorization \
-d client_id='CLIENT_ID' \
-d scope='openid profile offline_access'
Success response
{
"device_code": "DEVICE_CODE",
"user_code": "ABCD-EFGH",
"verification_uri": "https://sso.user.m7.org/device_login",
"verification_uri_complete": "https://sso.user.m7.org/device_login?user_code=ABCD-EFGH",
"expires_in": 600,
"interval": 5
}
Common errors
invalid_requestinvalid_scopeunauthorized_clientserver_error
Notes
- The current approval window is 10 minutes.
- The returned polling interval is currently 5 seconds.
- Admin applications are not allowed to use the device flow in the current implementation.