docs(api): add OAuth device authorization flow documentation#15977
Merged
docs(api): add OAuth device authorization flow documentation#15977
Conversation
Document the OAuth 2.0 Device Authorization Grant (RFC 8628) for headless clients like CLI tools, CI/CD pipelines, and Docker containers. Covers the complete flow: requesting device codes, displaying user instructions, polling for tokens, and handling errors. Includes a Python example implementation.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
BYK
approved these changes
Jan 13, 2026
|
|
||
| #### Step 2: Display Instructions to User | ||
|
|
||
| Display the user code and verification URL to your user: |
Member
There was a problem hiding this comment.
Good to mention they can also launch verification_uri_complete for ease of access
betegon
reviewed
Jan 13, 2026
Member
betegon
left a comment
There was a problem hiding this comment.
The endpoint URL is wrong. The actual implementation uses /oauth/device/code/, not /oauth/device_authorization/.
See the implementation PR: getsentry/sentry#105675
In src/sentry/web/urls.py:
re_path(r"^device/code/$", OAuthDeviceAuthorizationView.as_view()),Changes needed:
https://sentry.io/oauth/device_authorization/→https://sentry.io/oauth/device/code/DEVICE_AUTH_URL = 'https://sentry.io/oauth/device_authorization/'→DEVICE_AUTH_URL = 'https://sentry.io/oauth/device/code/'
betegon
requested changes
Jan 13, 2026
docs/api/auth.mdx
Outdated
| Request a device code from the device authorization endpoint: | ||
|
|
||
| ```bash | ||
| curl -X POST https://sentry.io/oauth/device_authorization/ \ |
Member
There was a problem hiding this comment.
the actual implementation uses /oauth/device/code/, not /oauth/device_authorization/.
See PR: getsentry/sentry#105675
In src/sentry/web/urls.py:
re_path(r"^device/code/$", OAuthDeviceAuthorizationView.as_view()),Changes needed:
https://sentry.io/oauth/device_authorization/→https://sentry.io/oauth/device/code/DEVICE_AUTH_URL = 'https://sentry.io/oauth/device_authorization/'→DEVICE_AUTH_URL = 'https://sentry.io/oauth/device/code/'
docs/api/auth.mdx
Outdated
| import requests | ||
|
|
||
| CLIENT_ID = 'your-client-id' | ||
| DEVICE_AUTH_URL = 'https://sentry.io/oauth/device_authorization/' |
Change endpoint from /oauth/device_authorization/ to /oauth/device/code/ to match the actual implementation in sentry. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
betegon
approved these changes
Jan 13, 2026
Member
Author
|
tbqh kind of surprised it fucked up the url like that - guessing it didnt review the entire commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add documentation for the OAuth 2.0 Device Authorization Grant (RFC 8628) to the API authentication docs.
This documents the device code flow implemented in getsentry/sentry@d4e4b74, which enables headless clients (CLI tools, CI/CD pipelines, Docker containers) to authenticate without a browser on the device.
The new section covers:
/oauth/device_authorization/authorization_pending,slow_down,access_denied,expired_token)