mirror of
https://github.com/better-auth/better-auth.git
synced 2026-08-03 08:49:26 -05:00
1.6 KiB
1.6 KiB
@better-auth/sso
| @better-auth/sso |
|---|
| patch |
fix(sso): unify SAML response processing and fix provider/config bugs
Bug 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)