Skip to content

feat: add OIDC third-party login initiation endpoint#4541

Open
gmbuell wants to merge 1 commit intoory:masterfrom
gmbuell:feat/oidc-third-party-login-init
Open

feat: add OIDC third-party login initiation endpoint#4541
gmbuell wants to merge 1 commit intoory:masterfrom
gmbuell:feat/oidc-third-party-login-init

Conversation

@gmbuell
Copy link

@gmbuell gmbuell commented Mar 2, 2026

Summary

  • Add /self-service/methods/oidc/third-party-login endpoint implementing OpenID Connect Third-Party Login Initiation
  • Accepts iss (required), login_hint (optional), and target_link_uri (optional) parameters
  • Looks up the matching configured OIDC provider by issuer URL, creates a login flow, and redirects directly to the provider's authorization endpoint — bypassing the login UI
  • HTTPS is required for iss in production; HTTP is allowed in dev mode (--dev)

Test plan

  • Unit tests covering all error paths (missing/invalid iss, unknown issuer, disallowed target_link_uri, strategy disabled)
  • Unit tests covering happy paths (redirect to provider, login_hint forwarding, target_link_uri acceptance, trailing slash normalization, POST method)
  • go test -tags sqlite ./selfservice/strategy/oidc/... passes
  • make format produces no changes

Implement OpenID Connect Third-Party Login Initiation, allowing
external parties to redirect users to Kratos with an `iss` parameter
to skip the login UI and go directly to the OIDC provider's
authorization endpoint.
@gmbuell gmbuell requested review from a team and aeneasr as code owners March 2, 2026 07:58
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