[PR #4183] [MERGED] feat(salesforce): add salesforce provider #30841

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4183
Author: @ShobhitPatra
Created: 8/23/2025
Status: Merged
Merged: 8/26/2025
Merged by: @himself65

Base: canaryHead: feat/salesforce-provider


📝 Commits (5)

  • b45353f feat(salesforce): add salesforce provider
  • 35f30c7 fix(salesforce): fix linting issues
  • 0a40c54 docs(salesforce): add docs for salesforce provider
  • 56aa329 chore(salesforce): enforce consistent naming conventions
  • 44018a4 Merge branch 'canary' into feat/salesforce-provider

📊 Changes

4 files changed (+329 additions, -0 deletions)

View changed files

📝 docs/components/sidebar-content.tsx (+19 -0)
docs/content/docs/authentication/salesforce.mdx (+153 -0)
📝 packages/better-auth/src/social-providers/index.ts (+3 -0)
packages/better-auth/src/social-providers/salesforce.ts (+154 -0)

📄 Description

Description

This PR adds a new Salesforce OAuth provider to Better Auth, enabling users to authenticate with Salesforce organizations (both production and sandbox environments).

Changes

  • Introduced new salesforcel provider in /packages/better-auth/src/providers/salesforce.ts
  • modified /packages/better-auth/src/providers/index.ts

Notes


Summary by cubic

Adds a Salesforce OAuth provider so apps can sign in with Salesforce. Works with production, sandbox, or a custom login URL.

  • New Features
    • New salesforce provider with environment option (production/sandbox), loginUrl override, and optional redirectURI override.
    • PKCE flow with createAuthorizationURL and validateAuthorizationCode; default scopes: openid, email, profile (customizable).
    • Fetches profile from /userinfo and maps to Better Auth user (id, name, email, image, emailVerified) with mapProfileToUser support.
    • Refresh token support (overridable). Provider exported and available in socialProviders.

🔄 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/4183 **Author:** [@ShobhitPatra](https://github.com/ShobhitPatra) **Created:** 8/23/2025 **Status:** ✅ Merged **Merged:** 8/26/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `feat/salesforce-provider` --- ### 📝 Commits (5) - [`b45353f`](https://github.com/better-auth/better-auth/commit/b45353f225d83f16a0816f22858161603ba5adee) feat(salesforce): add salesforce provider - [`35f30c7`](https://github.com/better-auth/better-auth/commit/35f30c7f3a3e46a093d9ae9814e540b2d4d108d7) fix(salesforce): fix linting issues - [`0a40c54`](https://github.com/better-auth/better-auth/commit/0a40c545f218e19336a88533dd7a4368ca605f8a) docs(salesforce): add docs for salesforce provider - [`56aa329`](https://github.com/better-auth/better-auth/commit/56aa32959d28ff7f6586d263ba373c135762d01f) chore(salesforce): enforce consistent naming conventions - [`44018a4`](https://github.com/better-auth/better-auth/commit/44018a46ec39af953fafb05109f42712931d8900) Merge branch 'canary' into feat/salesforce-provider ### 📊 Changes **4 files changed** (+329 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/components/sidebar-content.tsx` (+19 -0) ➕ `docs/content/docs/authentication/salesforce.mdx` (+153 -0) 📝 `packages/better-auth/src/social-providers/index.ts` (+3 -0) ➕ `packages/better-auth/src/social-providers/salesforce.ts` (+154 -0) </details> ### 📄 Description ## Description This PR adds a new Salesforce OAuth provider to Better Auth, enabling users to authenticate with Salesforce organizations (both production and sandbox environments). ## Changes - Introduced new salesforcel provider in /packages/better-auth/src/providers/salesforce.ts - modified /packages/better-auth/src/providers/index.ts ## Notes - Tested with production Salesforce org - Tested with sandbox environment - Implementation follows: https://help.salesforce.com/s/articleView?id=xcloud.remoteaccess_oauth_web_server_flow.htm&type=5 - - ### would add the docs once #4181 gets resolved <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds a Salesforce OAuth provider so apps can sign in with Salesforce. Works with production, sandbox, or a custom login URL. - **New Features** - New salesforce provider with environment option (production/sandbox), loginUrl override, and optional redirectURI override. - PKCE flow with createAuthorizationURL and validateAuthorizationCode; default scopes: openid, email, profile (customizable). - Fetches profile from /userinfo and maps to Better Auth user (id, name, email, image, emailVerified) with mapProfileToUser support. - Refresh token support (overridable). Provider exported and available in socialProviders. <!-- 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:51:16 -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#30841