Skip to content
This repository was archived by the owner on Oct 31, 2026. It is now read-only.

OAuth connectors discover their metadata: GitHub sends iss on its callback - #15

Merged
nicu-chiciuc merged 4 commits into
mainfrom
github-issuer
Oct 29, 2026
Merged

nicu-chiciuc merged 4 commits into
mainfrom
github-issuer

Conversation

@nicu-chiciuc

@nicu-chiciuc nicu-chiciuc commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Defect

Every sign-in through the GitHub connector fails at GET /connectors/github/callback. The hub logs Connector "github" failed: OperationProcessingError and sends the client back with server_error.

GitHub now adds the RFC 9207 iss parameter to its authorization response. A real callback to the hub on 2026-10-29 had this query shape:

?code=<redacted>&iss=https%3A%2F%2Fgithub.com%2Flogin%2Foauth&state=<redacted>

For a plain OAuth connector, the broker used the authorization endpoint (https://github.com/login/oauth/authorize) as the issuer. oauth4webapi validateAuthResponse refuses a response when its iss is not the same as the configured issuer. Google is an OIDC connector with a discovered issuer, so Google is not affected.

Shape

  • A plain OAuth connector now discovers its RFC 8414 metadata, as an OIDC connector discovers its OIDC metadata. OauthConnector keeps issuer and does not have authorizationEndpoint and tokenEndpoint now.
  • github() sets issuer: "https://github.com/login/oauth", the scopes, the credentials and the identity reader. It sets nothing more.
  • authorizationServer() uses the existing discovered cache to discover metadata for both kinds. The oauth kind uses discoveryRequest(issuer, { algorithm: "oauth2" }) and the oidc kind uses the OIDC call. processDiscoveryResponse validates both.
  • GitHub's document at https://github.com/.well-known/oauth-authorization-server/login/oauth gives authorization_endpoint, token_endpoint and authorization_response_iss_parameter_supported: true. Thus oauth4webapi refuses a GitHub response with an incorrect iss, and also a GitHub response with no iss (RFC 9207 section 2.4). No connector field gives information that the metadata gives.
  • The fake OAuth provider in the test harness serves its own RFC 8414 document. That document does not advertise iss support.
  • The version changes from 0.6.0 to 0.6.1. docs/design.md does not say how the broker gets upstream metadata, so it does not change.

Tests

github.test.ts uses 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:

  • A callback with the real parameter shape (code, then iss=https://github.com/login/oauth, then state) completes the sign-in.
  • A callback with an iss for a different issuer goes back to the client as server_error, and the code is not exchanged.
  • A callback with no iss goes back to the client as server_error, and the code is not exchanged. If the broker ignores the metadata flag, this test fails.

pnpm run check passes. Tests: 107 on main, 110 now (10 files).

Codex review

The one Codex pass found a should-fix: GitHub advertises iss support, but the broker accepted a GitHub callback with no iss. 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

nicu-chiciuc and others added 2 commits October 29, 2026 02:23
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>
@nicu-chiciuc nicu-chiciuc changed the title GitHub sends iss on its callback: the OAuth connector names its issuer OAuth connectors discover their metadata: GitHub sends iss on its callback Oct 29, 2026
nicu-chiciuc and others added 2 commits October 29, 2026 02:36
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@nicu-chiciuc
nicu-chiciuc merged commit b8758ef into main Oct 29, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant