[PR #6094] [MERGED] feat(oidc-provider): add RP-Initiated Logout endpoint #6440

Closed
opened 2026-03-13 12:59:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6094
Author: @himself65
Created: 11/19/2025
Status: Merged
Merged: 11/19/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/11/19/layout


📝 Commits (6)

  • c9bde46 feat(oidc-provider): add RP-Initiated Logout endpoint
  • f7e4b11 Update packages/better-auth/src/plugins/oidc-provider/index.ts
  • f7db0ed Update packages/better-auth/src/plugins/oidc-provider/index.ts
  • 7a8e3d8 Update packages/better-auth/src/plugins/oidc-provider/index.ts
  • 336e17c Update packages/better-auth/src/plugins/oidc-provider/index.ts
  • fa57bef fix: code

📊 Changes

3 files changed (+410 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/plugins/oidc-provider/index.ts (+309 -1)
📝 packages/better-auth/src/plugins/oidc-provider/oidc.test.ts (+95 -0)
📝 packages/better-auth/src/plugins/oidc-provider/types.ts (+6 -0)

📄 Description

Summary by cubic

Adds RP-Initiated Logout to the OIDC provider via /oauth2/endsession. Clients can log users out and optionally redirect; tokens and sessions are cleared for a clean sign-out.

  • New Features
    • Adds end_session_endpoint to OpenID metadata.
    • Supports GET/POST; validates id_token_hint, client_id, and post_logout_redirect_uri (must be registered).
    • Revokes user OAuth access tokens, deletes server session, and clears session cookie.
    • Redirects to post_logout_redirect_uri with optional state, or returns JSON success; tests cover metadata, redirects, validation errors, and POST support.

Written for commit fa57bef704. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6094 **Author:** [@himself65](https://github.com/himself65) **Created:** 11/19/2025 **Status:** ✅ Merged **Merged:** 11/19/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/11/19/layout` --- ### 📝 Commits (6) - [`c9bde46`](https://github.com/better-auth/better-auth/commit/c9bde466fe04d1a077a88036b6f188f95cb2cf11) feat(oidc-provider): add RP-Initiated Logout endpoint - [`f7e4b11`](https://github.com/better-auth/better-auth/commit/f7e4b113c23082cf172f3c7483b6da8dcf63e394) Update packages/better-auth/src/plugins/oidc-provider/index.ts - [`f7db0ed`](https://github.com/better-auth/better-auth/commit/f7db0edc90366d6e0245d7139edde3f49e942ffa) Update packages/better-auth/src/plugins/oidc-provider/index.ts - [`7a8e3d8`](https://github.com/better-auth/better-auth/commit/7a8e3d82888db478cd336240f406afaff397997f) Update packages/better-auth/src/plugins/oidc-provider/index.ts - [`336e17c`](https://github.com/better-auth/better-auth/commit/336e17ce039800299144f04b0ff26a37710db073) Update packages/better-auth/src/plugins/oidc-provider/index.ts - [`fa57bef`](https://github.com/better-auth/better-auth/commit/fa57bef7044943bb5680fa76140a5cb1e2e892d0) fix: code ### 📊 Changes **3 files changed** (+410 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/oidc-provider/index.ts` (+309 -1) 📝 `packages/better-auth/src/plugins/oidc-provider/oidc.test.ts` (+95 -0) 📝 `packages/better-auth/src/plugins/oidc-provider/types.ts` (+6 -0) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Adds RP-Initiated Logout to the OIDC provider via /oauth2/endsession. Clients can log users out and optionally redirect; tokens and sessions are cleared for a clean sign-out. - **New Features** - Adds end_session_endpoint to OpenID metadata. - Supports GET/POST; validates id_token_hint, client_id, and post_logout_redirect_uri (must be registered). - Revokes user OAuth access tokens, deletes server session, and clears session cookie. - Redirects to post_logout_redirect_uri with optional state, or returns JSON success; tests cover metadata, redirects, validation errors, and POST support. <sup>Written for commit fa57bef7044943bb5680fa76140a5cb1e2e892d0. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:59:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#6440