Skip to content

Add discovery_path option for non-standard discovery document paths - #214

Open
alexplatteeuw wants to merge 2 commits into
omniauth:masterfrom
alexplatteeuw:feat/discovery-path
Open

Add discovery_path option for non-standard discovery document paths#214
alexplatteeuw wants to merge 2 commits into
omniauth:masterfrom
alexplatteeuw:feat/discovery-path

Conversation

@alexplatteeuw

@alexplatteeuw alexplatteeuw commented May 29, 2026

Copy link
Copy Markdown

Context

Some providers run Keycloak (or similar) behind a custom login frontend. The standard .well-known/openid-configuration generated by Keycloak advertises its own /auth as authorization_endpoint, but users actually authenticate through the custom frontend (smartcard login, hardware MFA, etc.). The Keycloak endpoint itself doesn't render a usable login page.

These providers publish a second discovery document at a different path that overrides authorization_endpoint to point to the real login UI, while keeping everything else (token, userinfo, jwks, issuer) identical. We've hit this with Pro Sante Connect (French national health ID, uses .well-known/wallet-openid-configuration).

Right now the only workaround is to disable discovery and hardcode all endpoints.

Change

New option discovery_path, passed through to Config.discover! when set, ignored otherwise.

provider :openid_connect, {
  discovery: true,
  discovery_path: '.well-known/wallet-openid-configuration',
  issuer: 'https://auth.example.com/realms/my-realm',
}

Depends on the companion PR nov/openid_connect#113 that adds discovery_path to Resource#initialize and Config.discover!.

Related: #120

New option discovery_path, passed through to Config.discover! when set.
Allows using discovery mode with providers that publish their
configuration at a non-standard path.
Use keyword splat instead of branching with an artificial empty hash
for cache_options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant