[GH-ISSUE #3402] Add additional parameters similar to authorizationUrlParams to validateAuthorizationCode #9590

Closed
opened 2026-04-13 05:07:36 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @CaoMeiYouRen on GitHub (Jul 16, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/3402

Is this suited for github?

  • Yes, this is suited for github

I encountered a minor issue while integrating with OAuth 2.0. In the /oauth2.0/token interface provided by the other party, an additional fmt=json parameter is required for the response to be returned in JSON format.

However, there is currently no parameter similar to authorizationUrlParams that can be specified in validateAuthorizationCode, which leads to failure in obtaining the accessToken.

I hope this issue can be improved.

Describe the solution you'd like

Add additional parameters similar to authorizationUrlParams to validateAuthorizationCode

Describe alternatives you've considered

Add additional parameters

Additional context

7364c169f6/packages/better-auth/src/plugins/generic-oauth/index.ts (L460-L478)

7364c169f6/packages/better-auth/src/plugins/generic-oauth/index.ts (L596-L607)

Originally created by @CaoMeiYouRen on GitHub (Jul 16, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/3402 ### Is this suited for github? - [ ] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. I encountered a minor issue while integrating with OAuth 2.0. In the `/oauth2.0/token` interface provided by the other party, an additional `fmt=json` parameter is required for the response to be returned in JSON format. However, there is currently no parameter similar to authorizationUrlParams that can be specified in validateAuthorizationCode, which leads to failure in obtaining the accessToken. I hope this issue can be improved. ### Describe the solution you'd like Add additional parameters similar to authorizationUrlParams to validateAuthorizationCode ### Describe alternatives you've considered Add additional parameters ### Additional context https://github.com/better-auth/better-auth/blob/7364c169f6de0eec4f095112047e23480b240078/packages/better-auth/src/plugins/generic-oauth/index.ts#L460-L478 https://github.com/better-auth/better-auth/blob/7364c169f6de0eec4f095112047e23480b240078/packages/better-auth/src/plugins/generic-oauth/index.ts#L596-L607
GiteaMirror added the enhancementlocked labels 2026-04-13 05:07:36 -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#9590