Repository navigation
Conversation
OAuth-backed sessions currently only log out of Tinyauth. When the upstream provider keeps its SSO session, the next protected application access can immediately create a new Tinyauth session, so logout does not behave like an end-to-end sign-out for OIDC providers that support RP-initiated logout. Add an optional OAuth provider logoutUrl for the OpenID Provider end_session_endpoint and keep the provider id_token server-side on the Tinyauth session. The logout handler now deletes the local session, builds the OP logout request with client_id, id_token_hint, post_logout_redirect_uri, and state, and returns that redirect to the frontend. The callback endpoint validates and restores the requested application return URL after the OP hop. Persist oauth_id_token for SQLite, Postgres, memory, SQLC generated repositories, and store wrapper models so refreshed sessions retain the token. Add migrations for both database drivers. Update the logout page and quick actions menu to follow backend-provided redirect URLs while keeping Tinyauth redirect_uri separate from OIDC post_logout_redirect_uri. Cover the new behavior with controller tests for safe logout redirects, logout URL construction, and use of the server-side id_token. Enable TLS on the dev whoami route so the local Traefik setup exercises the secure-cookie and OIDC logout flow. Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-Authored-By: OpenAI Codex <codex@openai.com>
Refs: tinyauthapp#1094 (comment) Refs: tinyauthapp#1094 (comment) Refs: tinyauthapp#1094 (comment) Refs: tinyauthapp#1094 (comment) Co-Authored-By: OpenAI Codex <codex@openai.com>
Refs: tinyauthapp#1094 (comment) Refs: tinyauthapp#1094 (comment) Co-Authored-By: OpenAI Codex <codex@openai.com>
Refs: tinyauthapp#1094 (comment) Spec: OpenID Connect RP-Initiated Logout 1.0 end_session_endpoint MUST use https. Co-Authored-By: OpenAI Codex <codex@openai.com>
Refs: tinyauthapp#1094 (comment) Co-Authored-By: OpenAI Codex <codex@openai.com>
Refs: tinyauthapp#1094 (comment) Co-Authored-By: OpenAI Codex <codex@openai.com>
Refs: tinyauthapp#1094 (comment) Refs: tinyauthapp#1094 (comment) Co-Authored-By: OpenAI Codex <codex@openai.com>
Refs: tinyauthapp#1094 (comment) Refs: tinyauthapp#1094 (comment) Co-Authored-By: OpenAI Codex <codex@openai.com>
Refs: tinyauthapp#1094 (comment) Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-Authored-By: OpenAI Codex <codex@openai.com>
Refs: tinyauthapp#1094 (comment) Refs: tinyauthapp#1094 (comment) Co-Authored-By: OpenAI Codex <codex@openai.com>
Advertise RP-initiated logout in discovery, validate downstream ID token hints and registered post-logout redirects, and reuse the upstream logout cascade with one-time callback tickets. Co-Authored-By: OpenAI Codex <codex@openai.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Note to myself Will need to review the https://openid.net/specs/openid-connect-rpinitiated-1_0.html document before reviewing this. |
|
Note AI-generated review hint. This comment was written by an AI assistant (Claude, model Opus 5.5) and posted by me, per Looks conforming
Worth considering
|
Stack
This PR depends on #1094 and must merge after it. Because the branches are on a fork, GitHub requires this PR to target
main; its Files view will include the parent until #1094 merges. Review the endpoint-only change here:norrs/tinyauth@feat/sso-logout...feat/oidc-end-session
Summary
end_session_endpointin OIDC discoveryVerification
make testmake vetgo test -count=1 ./internal/controller ./internal/service