-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
docs(api): add OAuth device authorization flow documentation #15977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
|
|
|
||
| #### Step 2: Display Instructions to User | ||
|
|
||
| Display the user code and verification URL to your user: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to mention they can also launch verification_uri_complete for ease of access
betegon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/'
docs/api/auth.mdx
Outdated
| Request a device code from the device authorization endpoint: | ||
|
|
||
| ```bash | ||
| curl -X POST https://sentry.io/oauth/device_authorization/ \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
Change endpoint from /oauth/device_authorization/ to /oauth/device/code/ to match the actual implementation in sentry. Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
tbqh kind of surprised it fucked up the url like that - guessing it didnt review the entire commit |
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)