[PR #3548] [MERGED] fix(sso): include mapping inside samlConfig payload #21779

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3548
Author: @natetewelde
Created: 7/22/2025
Status: Merged
Merged: 7/23/2025
Merged by: @Bekacru

Base: mainHead: fix/saml-mapping-support


📝 Commits (1)

  • a9c8e26 fix(sso): include mapping inside samlConfig payload

📊 Changes

1 file changed (+9 additions, -0 deletions)

View changed files

📝 packages/sso/src/index.ts (+9 -0)

📄 Description

This PR fixes an issue where the mapping object provided during registerSSOProvider is not persisted for SAML providers. This causes all attribute mappings to resolve as undefined during the SAML login callback.

Fix:

  • Inject mapping into the serialized samlConfig object at registration time, matching how oidcConfig already handles mappings.

This ensures consistent behavior between OIDC and SAML flows and prevents failed user provisioning due to missing identity attributes.


Summary by cubic

Fixed an issue where SAML SSO providers did not persist the mapping object, causing attribute mappings to be undefined during login.

  • Bug Fixes
    • Injected the mapping into the samlConfig payload at registration to match OIDC behavior and ensure correct user attribute mapping.

🔄 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/3548 **Author:** [@natetewelde](https://github.com/natetewelde) **Created:** 7/22/2025 **Status:** ✅ Merged **Merged:** 7/23/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `fix/saml-mapping-support` --- ### 📝 Commits (1) - [`a9c8e26`](https://github.com/better-auth/better-auth/commit/a9c8e26f4f9b94eafe238037a3727866f1edf0fe) fix(sso): include mapping inside samlConfig payload ### 📊 Changes **1 file changed** (+9 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/sso/src/index.ts` (+9 -0) </details> ### 📄 Description This PR fixes an issue where the `mapping` object provided during `registerSSOProvider` is not persisted for SAML providers. This causes all attribute mappings to resolve as `undefined` during the SAML login callback. **Fix:** - Inject `mapping` into the serialized `samlConfig` object at registration time, matching how `oidcConfig` already handles mappings. This ensures consistent behavior between OIDC and SAML flows and prevents failed user provisioning due to missing identity attributes. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixed an issue where SAML SSO providers did not persist the mapping object, causing attribute mappings to be undefined during login. - **Bug Fixes** - Injected the mapping into the samlConfig payload at registration to match OIDC behavior and ensure correct user attribute mapping. <!-- 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-15 20:35:46 -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#21779