[PR #3388] [MERGED] fix(auth): implement standard Base64 encoding for HTTP Basic Auth in token refresh and validation #30397

Closed
opened 2026-04-17 21:30:24 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3388
Author: @naimkhrof
Created: 7/15/2025
Status: Merged
Merged: 7/15/2025
Merged by: @Bekacru

Base: mainHead: fix/basic-auth-encoding


📝 Commits (4)

  • d782e6c fix(auth): implement standard Base64 encoding for HTTP Basic Auth in token refresh and validation
  • fa97e5f fix(auth): utilize utility function for standard Base64 encoding in token refresh and validation
  • 63d90eb use better auth utils
  • 0201651 fix base 64 code api

📊 Changes

3 files changed (+9 additions, -6 deletions)

View changed files

📝 packages/better-auth/src/oauth2/refresh-access-token.ts (+4 -3)
📝 packages/better-auth/src/oauth2/validate-authorization-code.ts (+4 -3)
📝 packages/better-auth/src/plugins/generic-oauth/index.ts (+1 -0)

📄 Description

  • Updated refreshAccessToken and validateAuthorizationCode functions to use standard Base64 encoding instead of URL-safe encoding for HTTP Basic Authentication.
  • Ensured compatibility with providers like Notion and Twitter by adhering to OAuth2 specifications (RFC 7617).
  • Set default authentication method to "basic" in the generic OAuth plugin for better consistency.

Summary by cubic

Switched HTTP Basic Auth encoding to standard Base64 in token refresh and validation to fix compatibility with providers like Notion and Twitter. Set the default authentication method to "basic" in the generic OAuth plugin for better consistency.


🔄 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/3388 **Author:** [@naimkhrof](https://github.com/naimkhrof) **Created:** 7/15/2025 **Status:** ✅ Merged **Merged:** 7/15/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `fix/basic-auth-encoding` --- ### 📝 Commits (4) - [`d782e6c`](https://github.com/better-auth/better-auth/commit/d782e6c0473414ed0c8074fc3ccf7e721e72ab19) fix(auth): implement standard Base64 encoding for HTTP Basic Auth in token refresh and validation - [`fa97e5f`](https://github.com/better-auth/better-auth/commit/fa97e5f7582635f511e3f95c55fb69115c973b5f) fix(auth): utilize utility function for standard Base64 encoding in token refresh and validation - [`63d90eb`](https://github.com/better-auth/better-auth/commit/63d90eb7d87be54f8b8ab17ade843934fbb36bd5) use better auth utils - [`0201651`](https://github.com/better-auth/better-auth/commit/02016510e32458c38856438c6a8b17186b8a7cbe) fix base 64 code api ### 📊 Changes **3 files changed** (+9 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/oauth2/refresh-access-token.ts` (+4 -3) 📝 `packages/better-auth/src/oauth2/validate-authorization-code.ts` (+4 -3) 📝 `packages/better-auth/src/plugins/generic-oauth/index.ts` (+1 -0) </details> ### 📄 Description - Updated `refreshAccessToken` and `validateAuthorizationCode` functions to use standard Base64 encoding instead of URL-safe encoding for HTTP Basic Authentication. - Ensured compatibility with providers like Notion and Twitter by adhering to OAuth2 specifications (RFC 7617). - Set default authentication method to "basic" in the generic OAuth plugin for better consistency. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Switched HTTP Basic Auth encoding to standard Base64 in token refresh and validation to fix compatibility with providers like Notion and Twitter. Set the default authentication method to "basic" in the generic OAuth plugin for better consistency. <!-- 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-17 21:30:24 -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#30397