19 KiB
@better-auth/sso
1.7.0-beta.2
Patch Changes
- Updated dependencies [
9aed910,acbd6ef,954b664,39d6af2]:- better-auth@1.7.0-beta.2
- @better-auth/core@1.7.0-beta.2
1.7.0-beta.1
Minor Changes
-
#9117
b70f025Thanks @gustavovalverde! - ### Breaking: SAML configuration changescallbackUrlremoved fromsamlConfig. The ACS URL is now always derived from yourbaseURLandproviderId. RemovecallbackUrlfrom your SAML provider configuration. The post-login redirect destination is set per sign-in viacallbackURLinsignIn.sso():await authClient.signIn.sso({ providerId: "my-provider", callbackURL: "/dashboard", });/sso/saml2/callback/:providerIdendpoint removed. Update your IdP's ACS URL to/sso/saml2/sp/acs/:providerId. This endpoint handles both GET and POST requests.spMetadatais now optional. You no longer need to passspMetadata: {}when registering a provider. SP metadata is auto-generated from your configuration.Removed unused fields from
SAMLConfig:decryptionPvk,additionalParams,idpMetadata.entityURL,idpMetadata.redirectURL. These were stored but never read. Remove them from your configuration if present.Bug fixes
- Fix SLO SessionIndex matching: LogoutRequests with a SessionIndex were silently failing to delete the correct session.
- Audience validation now defaults to the SP entity ID when
audienceis not configured, per SAML Core section 2.5.1. - Restore
AllowCreatein AuthnRequests, required by IdPs that use JIT provisioning. - SP metadata endpoint now reflects actual SP capabilities (encryption, signing, SLO).
Patch Changes
-
#9121
9603043Thanks @gustavovalverde! - ### Security: upgrade samlify to 2.12.0Upgrades the SAML XML processing library from 2.10.2 to 2.12.0:
- XPath injection protection: all XPath expressions now use value escaping instead of string interpolation
- XXE prevention: the XML parser defaults to strict mode that rejects entity references
- Dependency reduction: removes
node-forge,pako,uuid, andcamelcasein favor of Node built-ins
PEM keys and certificates with leading whitespace are now normalized automatically before being passed to samlify. This prevents
DECODER routines::unsupportederrors when keys are copied from indented config files or environment variables.Requires Node 20+.
-
Updated dependencies [
5142e9c,484ce6a,f875897,c7d2253,9a6d475,513dabb,6f2948e]:- better-auth@1.7.0-beta.1
- @better-auth/core@1.7.0-beta.1
1.7.0-beta.0
Minor Changes
-
#8836
93d3871Thanks @gustavovalverde! - Addprivate_key_jwt(RFC 7523) client authentication across the stack. Servers verify JWT client assertions signed with asymmetric keys; clients sign them for authorization code, refresh, and client credentials flows. -
#9055
b790144Thanks @gustavovalverde! - fix(sso)!: harden SAML response validation (InResponseTo, Audience, SessionIndex)Breaking Changes
allowIdpInitiatednow defaults tofalse— IdP-initiated SSO (unsolicited SAML responses) is disabled by default. Setsaml.allowIdpInitiated: trueto restore the previous behavior. This aligns with the SAML2Int interoperability profile which recommends against IdP-initiated SSO due to its susceptibility to injection attacks.
Bug Fixes
- InResponseTo validation was completely non-functional — The code read
extract.inResponseTo(alwaysundefined) instead of samlify's actual pathextract.response.inResponseTo. SP-initiated InResponseTo validation now works as intended in both ACS handlers. - Audience Restriction was never validated — SAML assertions issued for a different service provider were accepted without checking the
<AudienceRestriction>element. Audience is now validated against the configuredsamlConfig.audiencevalue per SAML 2.0 Core §2.5.1. - SessionIndex stored as object instead of string — samlify returns
sessionIndexfrom login responses as{ authnInstant, sessionNotOnOrAfter, sessionIndex }, but the code stored the whole object. SLO session-index comparisons always failed silently. The correct innersessionIndexstring is now extracted.
Improvements
- Extracted shared
validateInResponseTo()andvalidateAudience()intopackages/sso/src/saml/response-validation.ts, eliminating ~160 lines of duplicated validation logic between the two ACS handlers. - Fixed
SAMLAssertionExtracttype to match samlify's actual extractor output shape.
1.6.7
Patch Changes
- Updated dependencies [
307196a,4a180f0,4f373ee,e1b1cfc,d053a45]:- better-auth@1.6.7
- @better-auth/core@1.6.7
1.6.6
Patch Changes
-
#9262
fe5f36cThanks @jonathansamines! - Fix ESM/CJS compat issue when loading samlify -
Updated dependencies [
b5742f9,4debfb6,9ea7eb1,a844c7d,ab4c10f,a61083e,e64ff72]:- @better-auth/core@1.6.6
- better-auth@1.6.6
1.6.5
Patch Changes
1.6.4
Patch Changes
1.6.3
Patch Changes
-
#9097
52c4751Thanks @gustavovalverde! - fix(sso): unify SAML response processing and fix provider/config bugsBug fixes:
- Fix SP metadata endpoint using internal row ID instead of
providerIdin ACS URL - Fix
acsEndpointskipping DB provider lookup whendefaultSSOis configured - Fix
acsEndpointmissing encryption fields (isAssertionEncrypted,encPrivateKey), which caused silent decryption failures - Fix
defaultSSOconfig parsing in callback path (safeJsonParseon already-parsed objects) - Fix
createSPmissingcallbackUrlfallback to auto-generated ACS URL - Complete
createSP/createIdPhelpers with all encryption and signing fields
Behavioral changes:
- ACS error redirect query parameters now use uppercase error codes (e.g.
error=SAML_MULTIPLE_ASSERTIONSinstead oferror=multiple_assertions). If your application parses these error codes from the redirect URL, update the expected values. - SAML provider registration now rejects configs with no usable IdP entry point (no valid
entryPointURL, noidpMetadata.metadata, and noidpMetadata.singleSignOnService). Previously these would register successfully but fail at sign-in. entryPointvalidation tightened fromstartsWith("http")tonew URL()parsing, rejecting malformed URLs likehttp:evilorhttp//missing-colon.
Refactoring (no API changes):
- Extract shared
processSAMLResponsepipeline to eliminate ~500 lines of duplicated logic betweencallbackSSOSAMLandacsEndpoint - Move
validateSAMLTimestamptosaml/timestamp.ts(re-exported from original location for compatibility)
- Fix SP metadata endpoint using internal row ID instead of
-
Updated dependencies [
6ce30cf,f6428d0,c5066fe,5f84335,93d3871,544f1c6]:- better-auth@1.7.0-beta.0
- @better-auth/core@1.7.0-beta.0
-
Updated dependencies [
5142e9c,484ce6a,f875897,6ce30cf,f6428d0,9a6d475,513dabb,c5066fe,5f84335]:- better-auth@1.6.3
- @better-auth/core@1.6.3
1.6.2
Patch Changes
-
#8968
5e5d3f6Thanks @cyphercodes! - fix(sso): strip whitespace from SAMLResponse before base64 decodingSome SAML IDPs send SAMLResponse with line-wrapped base64 (per RFC 2045), which caused decoding failures. Whitespace is now stripped at the request boundary before any processing.
-
Updated dependencies [
9deb793,2cbcb9b,b20fa42,608d8c3,8409843,e78a7b1]:- better-auth@1.6.2
- @better-auth/core@1.6.2
1.6.1
Patch Changes
1.6.0
Minor Changes
-
#8836
5dd9e44Thanks @gustavovalverde! - Enable InResponseTo validation by default for SAML flows -
#8836
5dd9e44Thanks @gustavovalverde! - Add optional version field to the plugin interface and expose version from all built-in plugins
Patch Changes
-
#8838
ee8b40dThanks @gustavovalverde! - pinsamlifyto~2.10.2to avoid breaking changes in v2.11.0 and patch transitivenode-forgevulnerability (4 HIGH CVEs: signature forgery, cert chain bypass, DoS) -
#8836
5dd9e44Thanks @gustavovalverde! - Fix provisionUser inconsistency between OIDC and SAML and add provisionUserOnEveryLogin option -
Updated dependencies [
dd537cb,bd9bd58,5dd9e44,5dd9e44,5dd9e44,5dd9e44,5dd9e44,5dd9e44,5dd9e44,5dd9e44,5dd9e44,5dd9e44,5dd9e44,5dd9e44,5dd9e44,469eee6,560230f]:- better-auth@1.6.0
- @better-auth/core@1.6.0
1.6.0-beta.0
Minor Changes
-
28b1291Thanks @gustavovalverde! - Enable InResponseTo validation by default for SAML flows -
28b1291Thanks @gustavovalverde! - Add optional version field to the plugin interface and expose version from all built-in plugins
Patch Changes
-
28b1291Thanks @gustavovalverde! - Fix provisionUser inconsistency between OIDC and SAML and add provisionUserOnEveryLogin option -
Updated dependencies [
28b1291,28b1291,28b1291,28b1291,28b1291,28b1291,28b1291,28b1291,28b1291,28b1291,28b1291,28b1291,28b1291]:- better-auth@1.6.0-beta.0
- @better-auth/core@1.6.0-beta.0