[PR #2507] [MERGED] feat: custom authorization request headers #21247

Closed
opened 2026-04-15 20:13:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/2507
Author: @KGALLET
Created: 5/1/2025
Status: Merged
Merged: 5/1/2025
Merged by: @Bekacru

Base: mainHead: feat/headers-authorization-request


📝 Commits (1)

  • 403a6dc feat: authorization request headers

📊 Changes

3 files changed (+71 additions, -11 deletions)

View changed files

📝 packages/better-auth/src/oauth2/validate-authorization-code.ts (+8 -5)
📝 packages/better-auth/src/plugins/generic-oauth/generic-oauth.test.ts (+53 -3)
📝 packages/better-auth/src/plugins/generic-oauth/index.ts (+10 -3)

📄 Description

Some OAuth2 provider asks headers to be passed on the authorization request.
In my case, I'm using Qonto and I need to pass a specific header for local development when calling any API endpoints (i.e. https://qonto.notion.site/08c9087f738340fc95a3cd61884f7700?v=15c985c4a8ff4d14b3806a6a42d00ecc&p=108734c9484b4e5cb190157e3093c149&pm=s)

API documentation: https://api-doc.qonto.com/docs/business-api/d6e8790ba0d51-token-endpoint


🔄 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/2507 **Author:** [@KGALLET](https://github.com/KGALLET) **Created:** 5/1/2025 **Status:** ✅ Merged **Merged:** 5/1/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `feat/headers-authorization-request` --- ### 📝 Commits (1) - [`403a6dc`](https://github.com/better-auth/better-auth/commit/403a6dcf37269116c5361ed68fcca1667bfe43c0) feat: authorization request headers ### 📊 Changes **3 files changed** (+71 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/oauth2/validate-authorization-code.ts` (+8 -5) 📝 `packages/better-auth/src/plugins/generic-oauth/generic-oauth.test.ts` (+53 -3) 📝 `packages/better-auth/src/plugins/generic-oauth/index.ts` (+10 -3) </details> ### 📄 Description Some OAuth2 provider asks headers to be passed on the authorization request. In my case, I'm using Qonto and I need to pass a specific header for local development when calling any API endpoints (i.e. https://qonto.notion.site/08c9087f738340fc95a3cd61884f7700?v=15c985c4a8ff4d14b3806a6a42d00ecc&p=108734c9484b4e5cb190157e3093c149&pm=s) API documentation: https://api-doc.qonto.com/docs/business-api/d6e8790ba0d51-token-endpoint --- <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-15 20:13:59 -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#21247