[PR #8398] [MERGED] fix(oidc-provider): validate redirect_uri for prompt=none #7951

Closed
opened 2026-03-13 13:54:17 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8398
Author: @jslno
Created: 3/4/2026
Status: Merged
Merged: 3/11/2026
Merged by: @himself65

Base: canaryHead: 03-04-2026/oidc-provider-redirect-uri-validation


📝 Commits (10+)

  • de9e2e0 fix(oidc-provider): validate redirect_uri for prompt=none
  • 9cadf72 chore: cleanup
  • c2417d9 chore: fix spelling
  • 8f04519 trigger ci
  • 8e886ce chore: cleanup
  • ac1705f trigger ci
  • 14cb487 chore: update test
  • 90cdeb2 chore: fix linting
  • 928202e Merge branch 'canary' into 03-04-2026/oidc-provider-redirect-uri-validation
  • 52c35d4 Merge branch 'canary' into 03-04-2026/oidc-provider-redirect-uri-validation

📊 Changes

3 files changed (+103 additions, -22 deletions)

View changed files

📝 packages/better-auth/src/plugins/oidc-provider/authorize.ts (+27 -4)
📝 packages/better-auth/src/plugins/oidc-provider/error.ts (+12 -1)
📝 packages/better-auth/src/plugins/oidc-provider/oidc.test.ts (+64 -17)

📄 Description

Summary

Fixes redirect_uri validation when prompt=none is used in the OIDC provider authorization flow.

  • Validates that redirect_uri is present, client_id is valid, and the redirect URI is registered for the client before redirecting with login_required error
  • Adds InvalidClient error class for OIDC-compliant error responses
  • Fixes InvalidRequest error to include the error field in the response

Closes #7700


🔄 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/8398 **Author:** [@jslno](https://github.com/jslno) **Created:** 3/4/2026 **Status:** ✅ Merged **Merged:** 3/11/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `03-04-2026/oidc-provider-redirect-uri-validation` --- ### 📝 Commits (10+) - [`de9e2e0`](https://github.com/better-auth/better-auth/commit/de9e2e0b6c50c047e60a72c8e10a3062fd883f80) fix(oidc-provider): validate redirect_uri for prompt=none - [`9cadf72`](https://github.com/better-auth/better-auth/commit/9cadf723068c0802981ca3a36dd40fd2d8a134ea) chore: cleanup - [`c2417d9`](https://github.com/better-auth/better-auth/commit/c2417d9c2be70387c20d89848200cfa9e887bd8b) chore: fix spelling - [`8f04519`](https://github.com/better-auth/better-auth/commit/8f0451906f65a2ff38d57954dfb0e851862074f5) trigger ci - [`8e886ce`](https://github.com/better-auth/better-auth/commit/8e886ce6730485a1c6e98370b6205615c5b2b223) chore: cleanup - [`ac1705f`](https://github.com/better-auth/better-auth/commit/ac1705fdc9b450baf2187c9b900a7b4574df4e8a) trigger ci - [`14cb487`](https://github.com/better-auth/better-auth/commit/14cb487ce9eaf7082a15a8a5be58c30f32c3a655) chore: update test - [`90cdeb2`](https://github.com/better-auth/better-auth/commit/90cdeb2456169ae20bfd75dcb130e1304db56ba4) chore: fix linting - [`928202e`](https://github.com/better-auth/better-auth/commit/928202eb1fa360db480fee818d119d3f4c46c229) Merge branch 'canary' into 03-04-2026/oidc-provider-redirect-uri-validation - [`52c35d4`](https://github.com/better-auth/better-auth/commit/52c35d40654776c72c9bf4a535a6b17dcb43e94a) Merge branch 'canary' into 03-04-2026/oidc-provider-redirect-uri-validation ### 📊 Changes **3 files changed** (+103 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/oidc-provider/authorize.ts` (+27 -4) 📝 `packages/better-auth/src/plugins/oidc-provider/error.ts` (+12 -1) 📝 `packages/better-auth/src/plugins/oidc-provider/oidc.test.ts` (+64 -17) </details> ### 📄 Description ## Summary Fixes redirect_uri validation when `prompt=none` is used in the OIDC provider authorization flow. - Validates that `redirect_uri` is present, `client_id` is valid, and the redirect URI is registered for the client before redirecting with `login_required` error - Adds `InvalidClient` error class for OIDC-compliant error responses - Fixes `InvalidRequest` error to include the `error` field in the response Closes #7700 --- <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 13:54:17 -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#7951