docs(oidc): fix Callback error-status note to reflect 400/401/500#70
Merged
veverkap merged 1 commit intoApr 23, 2026
Merged
Conversation
The blockquote note following the Link redirect-outcomes table stated that pre-link-flow Callback errors are 'surfaced as JSON error responses (HTTP 401)'. In practice, Callback can return three distinct HTTP status codes: - 400 Bad Request: missing state cookie, invalid state, missing PKCE verifier cookie, missing authorization_code, or missing sub/email claims - 401 Unauthorized: provider error param, token exchange failure, missing or invalid id_token, or unverified OIDC email - 500 Internal Server Error: claim-parsing failure, user resolution failure, or JWT creation failure The error response table directly below the note already documents all three codes correctly; this commit aligns the prose note with the table. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR corrects an inaccurate note in the OIDCHandler documentation so it matches the actual Callback handler behavior (JSON error responses can be 400, 401, or 500, not only 401).
Changes:
- Update the
OIDCHandlerlink-flow note to reflectCallbackJSON error status codes400/401/500instead of only401.
Show a summary per file
| File | Description |
|---|---|
| README.md | Fixes the OIDCHandler Callback error-status note to align with the documented error table and handler/oidc.go behavior. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
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.
Summary
The blockquote note following the
OIDCHandlerLink redirect-outcomes table contained an inaccuracy: it stated that pre-link-flowCallbackerrors are "surfaced as JSON error responses (HTTP 401) rather than redirects". In practice,Callbackcan return three distinct HTTP status codes, not just 401.This was identified as an outstanding gap across three previously-opened PRs (#64, #67, #69), none of which have been merged. This PR makes the minimal, targeted fix.
What changed
README.mdline 612 — one-word change in the blockquote note:Why this matters
The note sits immediately before the
#### Error responsestable that correctly documents all three status codes:400 Bad Requestauthorization_code, or missingsub/emailclaims401 Unauthorizederrorparam, code exchange failure, missing/invalidid_token, or unverified OIDC email500 Internal Server ErrorThe prose note contradicted its own table. Clients that relied solely on the note (rather than the table) would not handle 400/500 responses from
Callback, resulting in silent failures for those error paths.Verification
Checked against
handler/oidc.goCallbackfunction — allwriteErrorcall sites:missing state cookie,invalid state parameter,missing PKCE verifier cookie,missing authorization code,sub and email claims requiredauthentication failed(provider error param),failed to exchange code,missing id_token,invalid id_token,OIDC email must be verifiedfailed to parse claims,failed to process user,failed to create sessionNo code changes; documentation only.
Warning
The following domain was blocked by the firewall during workflow execution:
proxy.golang.orgTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
Greptile Summary
This is a one-word documentation fix that corrects an inaccurate status-code claim in
README.mdline 612. The blockquote previously stated that pre-link-flowCallbackerrors are surfaced as HTTP 401; the fix expands this to "HTTP 400, 401, or 500 as appropriate", which is confirmed by thewriteErrorcall sites inhandler/oidc.goand aligns the note with the Error responses table directly below it.Confidence Score: 5/5
Safe to merge — documentation-only fix verified against source code.
No code changes; the updated text is confirmed accurate by the
writeErrorcall sites inhandler/oidc.goand is consistent with the adjacent Error responses table. No logic, security, or API contract is affected.No files require special attention.
Important Files Changed
writeErrorcall sites inhandler/oidc.goand the Error responses table immediately below.Sequence Diagram
sequenceDiagram participant Client participant OIDCHandler as OIDCHandler (Callback) participant Provider as OIDC Provider Client->>OIDCHandler: GET /callback?code=...&state=... OIDCHandler->>OIDCHandler: Validate state cookie / PKCE verifier alt Missing cookie, invalid state, missing code, missing claims OIDCHandler-->>Client: 400 Bad Request (JSON) end OIDCHandler->>Provider: Exchange code for tokens alt Provider error param / exchange failure / invalid id_token / unverified email OIDCHandler-->>Client: 401 Unauthorized (JSON) end OIDCHandler->>OIDCHandler: Parse claims, resolve user, create JWT alt Claims parse failure / user resolution failure / JWT creation failure OIDCHandler-->>Client: 500 Internal Server Error (JSON) end alt Link flow active OIDCHandler-->>Client: Redirect /?oidc_linked=true or /?oidc_link_error=… else Normal login OIDCHandler-->>Client: 200 OK + JWT endReviews (1): Last reviewed commit: "docs(oidc): fix Callback error-status no..." | Re-trigger Greptile