[PR #3438] [MERGED] feat: Add support for public clients in OIDC provider #13069

Closed
opened 2026-04-13 08:43:52 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3438
Author: @mohebifar
Created: 7/18/2025
Status: Merged
Merged: 7/18/2025
Merged by: @Bekacru

Base: v1.3Head: fix/oidc-public-client


📝 Commits (1)

  • 8648ffd fix(oidc-provider): update client validation logic for public and confidential clients

📊 Changes

1 file changed (+20 additions, -3 deletions)

View changed files

📝 packages/better-auth/src/plugins/oidc-provider/index.ts (+20 -3)

📄 Description

This is a follow-up to: https://github.com/better-auth/better-auth/pull/3091

#3091 adds support for public clients to the MCP plugin's OIDC implementation but for oidc-provider plugin, it implements it partially.

The only thing missing in oidc-provider was skipping the !client_secret check which expects the client_secret to have been provided in the request body and causes a 401 error. We should conditionally run that condition only when the client type is not "public".

Similar to MCP, PKCE is gonna be mandatory i.e. code_verifier parameter is required


Summary by cubic

Added support for public clients in the OIDC provider by skipping client_secret checks and requiring PKCE for these clients.

  • New Features
    • Public clients can now authenticate without a client_secret.
    • PKCE (code_verifier) is required for public clients.

🔄 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/3438 **Author:** [@mohebifar](https://github.com/mohebifar) **Created:** 7/18/2025 **Status:** ✅ Merged **Merged:** 7/18/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `v1.3` ← **Head:** `fix/oidc-public-client` --- ### 📝 Commits (1) - [`8648ffd`](https://github.com/better-auth/better-auth/commit/8648ffd2a6382b277ff97d35c729cc31051eb615) fix(oidc-provider): update client validation logic for public and confidential clients ### 📊 Changes **1 file changed** (+20 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/oidc-provider/index.ts` (+20 -3) </details> ### 📄 Description This is a follow-up to: https://github.com/better-auth/better-auth/pull/3091 #3091 adds support for public clients to the MCP plugin's OIDC implementation but for oidc-provider plugin, it implements it partially. The only thing missing in oidc-provider was skipping the `!client_secret` check which expects the client_secret to have been provided in the request body and causes a 401 error. We should conditionally run that condition only when the client type is not "public". Similar to MCP, PKCE is gonna be mandatory i.e. `code_verifier` parameter is required <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Added support for public clients in the OIDC provider by skipping client_secret checks and requiring PKCE for these clients. - **New Features** - Public clients can now authenticate without a client_secret. - PKCE (code_verifier) is required for public clients. <!-- 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-04-13 08:43:52 -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#13069