[GH-ISSUE #2655] bug: OIDC client secret required in PKCE flow #26609

Closed
opened 2026-04-17 17:14:34 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @ndaba1 on GitHub (May 14, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/2655

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Install the OIDC plugin
  2. Register a client
  3. Initiate oauth flow with PKCE

Current vs. Expected behavior

The OIDC provider cannot work correctly with public clients as pkce is not supported correctly. A client secret is always required in the token endpoint

What version of Better Auth are you using?

1.2.7

Provide environment information

OS: macOS Sonoma 14.3

Which area(s) are affected? (Select all that apply)

Backend

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

No response

Originally created by @ndaba1 on GitHub (May 14, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/2655 ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. Install the OIDC plugin 2. Register a client 3. Initiate oauth flow with PKCE ### Current vs. Expected behavior The OIDC provider cannot work correctly with public clients as pkce is not supported correctly. A client secret is always required in the token endpoint ### What version of Better Auth are you using? 1.2.7 ### Provide environment information ```bash OS: macOS Sonoma 14.3 ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the locked label 2026-04-17 17:14:34 -05:00
Author
Owner

@kziemski commented on GitHub (May 14, 2025):

@ndaba1 were you trying to use bette-auth for MCP auth use case?

<!-- gh-comment-id:2880797619 --> @kziemski commented on GitHub (May 14, 2025): @ndaba1 were you trying to use bette-auth for MCP auth use case?
Author
Owner

@ndaba1 commented on GitHub (May 15, 2025):

@ndaba1 were you trying to use bette-auth for MCP auth use case?

Not really, no

<!-- gh-comment-id:2882575954 --> @ndaba1 commented on GitHub (May 15, 2025): > [@ndaba1](https://github.com/ndaba1) were you trying to use bette-auth for MCP auth use case? Not really, no
Author
Owner

@julen commented on GitHub (Aug 14, 2025):

If I'm not mistaken this should've been fixed by #3438.

<!-- gh-comment-id:3188285958 --> @julen commented on GitHub (Aug 14, 2025): If I'm not mistaken this should've been fixed by #3438.
Author
Owner

@dosubot[bot] commented on GitHub (Nov 13, 2025):

Hi, @ndaba1. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a bug in Better Auth v1.2.7 where the OIDC plugin mishandled PKCE, requiring a client secret for public clients during token exchange.
  • Maintainer kziemski asked if this was related to MCP auth, which you clarified it was not.
  • Contributor julen suggested that pull request #3438 likely resolved this issue.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of better-auth by commenting here.
  • If I don’t hear back from you within 7 days, this issue will be automatically closed.

Thanks for your understanding and contribution!

<!-- gh-comment-id:3528570393 --> @dosubot[bot] commented on GitHub (Nov 13, 2025): Hi, @ndaba1. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a bug in Better Auth v1.2.7 where the OIDC plugin mishandled PKCE, requiring a client secret for public clients during token exchange. - Maintainer kziemski asked if this was related to MCP auth, which you clarified it was not. - Contributor julen suggested that pull request #3438 likely resolved this issue. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of better-auth by commenting here. - If I don’t hear back from you within 7 days, this issue will be automatically closed. Thanks for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#26609