/api/apps/{app_id}/device-authorizationAuthenticatedEnable or disable an app's device authorization grant
Enables or disables the OAuth 2.0 device authorization grant (RFC 8628) for the client application. Enable it for apps that run where the login page cannot be shown, such as command-line tools or TV apps: the app then asks POST /api/oidc/device_authorization for a code, and its users approve it on the auth server's /device page. It is off by default because whoever starts a device flow chooses who is shown its code: anyone who knows the app's id can ask a user to approve a request in the app's name. Disabling takes effect at once: the app's requests that were not redeemed yet are discarded, and devices still polling get unauthorized_client. Dynamically registered clients can never use the grant, so the setting cannot be changed for them either way (409). Idempotent. Requires management access; hardcoded apps cannot be configured.
put_api_apps_app_id_device_authorizationClient applicationsAuthentication & permissionsAuthenticated
Any authenticated user
- Accepted credentials
- Auth server session (refresh token cookie)
cookie "refresh_token_<auth_server_app_id>" - Access token (cookie)
cookie "access_token_<auth_server_app_id>" - Access token (Bearer)
Authorization: Bearer <JWT>
- Auth server session (refresh token cookie)
- Who may call
- Any authenticated user
Path parameters
| Name | Type | Description |
|---|---|---|
| app_id* | string | Client application id |
Request body
Required
| Property | Type | Description |
|---|---|---|
| enabled* | boolean | Enable or disable the device authorization grant for the app. Disabling discards the app's device sign-in requests that were not redeemed yet. |
Responses
| Property | Type | Description |
|---|---|---|
| success* | true | |
| available* | boolean | Whether the app can use the grant at all: false for dynamically registered clients, which never can |
| enabled* | boolean | Whether the app may start device flows ( |
| enabled_at* | integer | null | null | When it was enabled (Unix epoch ms); null when disabled |
Example request
curl -X PUT 'https://auth.botreeinc.com/api/apps/<app_id>/device-authorization' \
-b 'refresh_token_<auth_server_app_id>=<value>' \
-H 'Content-Type: application/json' \
-d '{
"enabled": true
}'