This repository was archived by the owner on Oct 31, 2026. It is now read-only.
Repository navigation
OAuth connectors discover their metadata: GitHub sends iss on its callback - #15
Merged
Merged
Conversation
GitHub now appends the RFC 9207 iss parameter, https://github.com/login/oauth, to its authorization response. The plain OAuth connector used its authorization endpoint as the issuer, so oauth4webapi refused every GitHub callback with OperationProcessingError. OauthConnector now has a required issuer, github() sets GitHub's, and the callback test sends the real parameter shape (code, iss, state) and a mismatched iss. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A plain OAuth connector now names only its issuer. The broker discovers its RFC 8414 metadata through the same cache as OIDC discovery, so the endpoints come from the provider. GitHub's metadata advertises authorization_response_iss_parameter_supported, so oauth4webapi now also refuses a GitHub callback without iss (RFC 9207 section 2.4). The GitHub stub serves the live metadata document as a fixture, and a third callback test sends no iss. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Defect
Every sign-in through the GitHub connector fails at
GET /connectors/github/callback. The hub logsConnector "github" failed: OperationProcessingErrorand sends the client back withserver_error.GitHub now adds the RFC 9207
issparameter to its authorization response. A real callback to the hub on 2026-10-29 had this query shape:For a plain OAuth connector, the broker used the authorization endpoint (
https://github.com/login/oauth/authorize) as the issuer. oauth4webapivalidateAuthResponserefuses a response when itsissis not the same as the configured issuer. Google is an OIDC connector with a discovered issuer, so Google is not affected.Shape
OauthConnectorkeepsissuerand does not haveauthorizationEndpointandtokenEndpointnow.github()setsissuer: "https://github.com/login/oauth", the scopes, the credentials and the identity reader. It sets nothing more.authorizationServer()uses the existingdiscoveredcache to discover metadata for both kinds. The oauth kind usesdiscoveryRequest(issuer, { algorithm: "oauth2" })and the oidc kind uses the OIDC call.processDiscoveryResponsevalidates both.https://github.com/.well-known/oauth-authorization-server/login/oauthgivesauthorization_endpoint,token_endpointandauthorization_response_iss_parameter_supported: true. Thus oauth4webapi refuses a GitHub response with an incorrectiss, and also a GitHub response with noiss(RFC 9207 section 2.4). No connector field gives information that the metadata gives.isssupport.docs/design.mddoes not say how the broker gets upstream metadata, so it does not change.Tests
github.test.tsuses GitHub's live metadata document, fetched on 2026-10-29, as a fixture. The comment gives its source URL. All three callback tests go through the full broker harness:code, theniss=https://github.com/login/oauth, thenstate) completes the sign-in.issfor a different issuer goes back to the client asserver_error, and the code is not exchanged.issgoes back to the client asserver_error, and the code is not exchanged. If the broker ignores the metadata flag, this test fails.pnpm run checkpasses. Tests: 107 on main, 110 now (10 files).Codex review
The one Codex pass found a should-fix: GitHub advertises
isssupport, but the broker accepted a GitHub callback with noiss. Discovery closes this finding. The other four questions had no finding: the issuer value, the token and OIDC paths, the tests, and other oauth-kind connectors.🤖 Generated with Claude Code