OIDC deployments cannot authorize a third-party application: the device grant is accounts-only (#81) - #89
Open
jan21deepak wants to merge 1 commit into
Open
OIDC deployments cannot authorize a third-party application: the device grant is accounts-only (#81)#89jan21deepak wants to merge 1 commit into
jan21deepak wants to merge 1 commit into
Conversation
Enable RFC 8628 device authorization for OIDC deployments alongside accounts mode, so third-party applications can receive scoped, revocable delegated tokens instead of full session JWTs from the cli-ticket flow. - Mount /oauth/* when unsupported_reason() passes (accounts + full OIDC) - Refuse GitHub OAuth and header mode with clear startup warnings - Gate consent on session auth_time, not iat (accounts login + OIDC callback) - Forward reauth=1 to IdP as prompt=login + max_age=0; verify auth_time - Add tests for OIDC mount, reauth prompt forwarding, and callback checks Fixes #81 Co-authored-by: jan21deepak <jan21deepak@users.noreply.github.com>
Owner
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 17e53eb. Configure here.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Opened automatically by Cursor Forge as a same-repo PR on
jan21deepak/omnigentafter the Cloud Agent pushed
cursor/oidc-device-grant-7cd5(not against an upstream parent).Fixes #81.
Cursor agent:
bc-ef0ddc19-7ffa-49f6-b9d2-ea207bc27cd5Note
High Risk
Changes authentication consent gating, OIDC login/callback behavior, and session JWT claims—security-sensitive paths where a mistake could weaken device-grant phishing defenses or break OIDC logins.
Overview
Enables the RFC 8628 device grant on OIDC deployments (still opt-in via
OMNIGENT_DEVICE_GRANT_ENABLED), so external clients can get scoped delegated tokens—not only accounts mode. First-party CLI/Slack keep using cli-login on OIDC; the design doc calls that out.Consent anti-phishing is tightened for OIDC. The device consent page no longer trusts session
iat(IdP silent SSO can mint a “fresh” cookie without user action). Sessions now carry optionalauth_timewhen credentials were actually verified; accounts logins set it on password/magic/setup; OIDC sets it only when the IdP attests a fresh login via verifiedid_tokenauth_time. Consent requiresauth_time ≥ grant.created_at. Every login bounce from consent usesreauth=1; OIDC/auth/loginforwards that asprompt=login+max_age=0, and the callback 403s if a forced re-auth was requested but the IdP reused a session.Mount policy and operator UX:
unsupported_reasonblocks header mode (no mintable session) and non-OIDC providers like GitHub (noprompt/auth_time).app.pyevaluates this before the auth-router block so header-mode operators get a warning when the flag is set but/oauth/*cannot mount.return_toon consent bounces is URL-encoded so odduser_codevalues don’t break the round-trip.Tests cover OIDC mount, GitHub refusal, reauth prompt forwarding, callback verification, and consent with proven vs unproven cookies.
Reviewed by Cursor Bugbot for commit 17e53eb. Bugbot is set up for automated code reviews on this repo. Configure here.