[PR #4866] [MERGED] feat(sso): provide default service provider metadata #13874

Closed
opened 2026-04-13 09:11:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4866
Author: @dvanmali
Created: 9/24/2025
Status: Merged
Merged: 9/24/2025
Merged by: @dvanmali

Base: canaryHead: ssoPatch


📝 Commits (3)

  • 6a142d3 feat: provide default sp metadata
  • 1c2266c style: add SAML config typing
  • 6cdd76c fix: suggestion by cubic

📊 Changes

2 files changed (+107 additions, -18 deletions)

View changed files

📝 packages/sso/src/index.ts (+36 -10)
📝 packages/sso/src/saml.test.ts (+71 -8)

📄 Description

Provides default sp metadata for the /sso/saml2/sp/metadata endpoint. Additional improvements with type specifying SAMLConfig type when needed.

Fixes: #4833


Summary by cubic

Adds default Service Provider metadata for /sso/saml2/sp/metadata when none is provided, so SAML works out of the box with minimal config. Also tightens SAMLConfig typing and safely handles partial IdP/ SP configs.

  • New Features

    • Auto-generate SP metadata (entityID, ACS URL, HTTP-POST binding).
    • Respect wantAssertionsSigned and identifierFormat (NameIDFormat) in generated metadata.
    • Adds test covering SP metadata output.
  • Refactors

    • Apply SAMLConfig typing when parsing provider.samlConfig.
    • Use optional fields for idpMetadata and spMetadata to avoid crashes with partial configs.

🔄 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/4866 **Author:** [@dvanmali](https://github.com/dvanmali) **Created:** 9/24/2025 **Status:** ✅ Merged **Merged:** 9/24/2025 **Merged by:** [@dvanmali](https://github.com/dvanmali) **Base:** `canary` ← **Head:** `ssoPatch` --- ### 📝 Commits (3) - [`6a142d3`](https://github.com/better-auth/better-auth/commit/6a142d323344832ffe1d58b04275f74a025d921e) feat: provide default sp metadata - [`1c2266c`](https://github.com/better-auth/better-auth/commit/1c2266c695b31092af3a0181a34974ae397c216f) style: add SAML config typing - [`6cdd76c`](https://github.com/better-auth/better-auth/commit/6cdd76c2819526d0b1aace11d00289fbae5971ad) fix: suggestion by cubic ### 📊 Changes **2 files changed** (+107 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `packages/sso/src/index.ts` (+36 -10) 📝 `packages/sso/src/saml.test.ts` (+71 -8) </details> ### 📄 Description Provides default sp metadata for the `/sso/saml2/sp/metadata` endpoint. Additional improvements with type specifying `SAMLConfig` type when needed. Fixes: #4833 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds default Service Provider metadata for /sso/saml2/sp/metadata when none is provided, so SAML works out of the box with minimal config. Also tightens SAMLConfig typing and safely handles partial IdP/ SP configs. - **New Features** - Auto-generate SP metadata (entityID, ACS URL, HTTP-POST binding). - Respect wantAssertionsSigned and identifierFormat (NameIDFormat) in generated metadata. - Adds test covering SP metadata output. - **Refactors** - Apply SAMLConfig typing when parsing provider.samlConfig. - Use optional fields for idpMetadata and spMetadata to avoid crashes with partial configs. <!-- 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-13 09:11:30 -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#13874