Skip to content

docs: move the SAML ACS URL to /sp/acs and document IdP-initiated sign-in [ENG-1736] - #33

Merged
twk3 merged 3 commits into
mainfrom
docs/eng-1736-saml-acs-url
Oct 14, 2026
Merged

twk3 merged 3 commits into
mainfrom
docs/eng-1736-saml-acs-url

Conversation

@twk3

@twk3 twk3 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Updates the SAML SSO docs for Better Auth 1.7.1, which this release ships (ENG-1736). Both changes break SSO sign-in for an install that doesn't act, so the CHANGELOG lists them as Breaking Changes.

What changed in the API

  • The ACS URL moved from /api/auth/sso/saml2/callback/<provider id> to /api/auth/sso/saml2/sp/acs/<provider id>. The old path answers 404; there is no redirect.
  • IdP-initiated sign-ins are refused, for example from an Okta tile or the Entra My Apps portal. Better Auth accepted them up to 1.6 and refuses them from 1.7. The API turns them back on with SSO_SAML_ALLOW_IDP_INITIATED=true, which it already reads, but which wasn't documented.
  • 1.7.1 checks the assertion's Recipient and Destination against the ACS URL, so an IdP with those set separately has to update them too.
  • The Audience is still SSO_SAML_ISSUER. Better Auth uses the configured issuer as the SP entity ID, and the expected audience is that entity ID, so the Audience doesn't change.
  • The SP metadata is new: it's served at /api/auth/sso/saml2/sp/metadata?providerId=<provider id>. The env-configured provider is found there too.

Changes

  • docs/sso-saml.md:
    • the new ACS URL, with Recipient and Destination set to it;
    • the SP metadata URL;
    • SSO_SAML_ALLOW_IDP_INITIATED in the optional settings;
    • troubleshooting entries for a Recipient or Destination mismatch, and for sign-in from the IdP's dashboard.
  • on-prem/.env.example: the new ACS URL in the setup summary, and a commented SSO_SAML_ALLOW_IDP_INITIATED line.
  • docs/configuration.md: the ACS URL in the provider id row, and a row for the new variable.
  • on-prem/CHANGELOG.md [Unreleased]:
    • Breaking Changes: the ACS move, with the steps to take in the IdP, and the refused IdP-initiated sign-ins;
    • New Environment Variables: SSO_SAML_ALLOW_IDP_INITIATED.

No compose change: api reads .env through env_file, so the new variable reaches it as is. SSO_SAML_SP_CERT_FILE was already removed in #31.

Testing

Docs only. The behavior was read from the API (packages/api/src/lib/sso.ts, config.ts) and from @better-auth/sso 1.7.1 (createSP, getExpectedSAMLRecipients, findSAMLProvider, spMetadata). It wasn't exercised against a real IdP.

Related

Checklist

  • PR title is Changelog-friendly: (fix|feat|chore): title [CSR-xxx]
  • User-friendly and meaningful description of the changes
  • Documentation was updated

🤖 Generated with Claude Code

https://claude.ai/code/session_01UhM4wHR2xPP8bbrkXGaqUD


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…n-in [ENG-1736]

Better Auth 1.7.1 serves the ACS at /api/auth/sso/saml2/sp/acs/<id>; the
old /saml2/callback/<id> path answers 404. It also checks the
assertion's Recipient and Destination against that URL, and refuses
IdP-initiated sign-ins unless SSO_SAML_ALLOW_IDP_INITIATED=true, which
the API already reads. The Audience is still SSO_SAML_ISSUER.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhM4wHR2xPP8bbrkXGaqUD
@baz-reviewer

baz-reviewer Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review this PR on Baz

Baz Summary

Update the SAML SSO documentation and release notes for Better Auth 1.7.1, including the new ACS and SP metadata endpoints, stricter Recipient/Destination validation, and IdP-initiated sign-in behavior. Document SSO_SAML_ALLOW_IDP_INITIATED and provide upgrade steps so customers can update their IdP configuration without losing SSO access.

Topics

TopicDetails
SAML SSO Guidance Document the new SAML ACS and SP metadata endpoints, require matching Recipient and Destination URLs, clarify that the Audience remains SSO_SAML_ISSUER, and add troubleshooting and configuration guidance for IdP-initiated sign-ins via SSO_SAML_ALLOW_IDP_INITIATED.
Modified files (3)
  • docs/configuration.md
  • docs/sso-saml.md
  • on-prem/.env.example
Latest Contributors(1)
UserCommitDate
dj@currents.devdocs: name the provide...October 14, 2026
SAML Upgrade Notes Warn on-prem customers about the breaking SAML endpoint and IdP-initiated sign-in changes, and provide upgrade steps plus the new environment variable in the release notes.
Modified files (1)
  • on-prem/CHANGELOG.md
Latest Contributors(1)
UserCommitDate
dj@currents.devdocs: name the Okta ch...October 14, 2026

Merger  Activate to get a short verdict whether this PR is good to go or not

Skills  Activate Skill Maintainer to keep your skills up to date

Planner  This PR would have been improved with Baz Planner - Try it now

Comment thread on-prem/CHANGELOG.md Outdated
… [ENG-1736]

"Okta does this by default" did not say what Okta does. The upgrade note
now also says the services keep serving while the scheduler migrates,
and which reads can leave out older runs until it is done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhM4wHR2xPP8bbrkXGaqUD
@twk3
twk3 marked this pull request as ready for review October 14, 2026 17:59
Comment thread on-prem/.env.example Outdated
Comment thread docs/sso-saml.md Outdated
The .env.example summary gave /acs/okta while SSO_SAML_PROVIDER_ID
defaults to onprem-saml, and the SP metadata URL read as if okta were
literal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhM4wHR2xPP8bbrkXGaqUD
@twk3
twk3 merged commit d432e5f into main Oct 14, 2026
2 checks passed
@twk3
twk3 deleted the docs/eng-1736-saml-acs-url branch October 14, 2026 19:10
@twk3 twk3 mentioned this pull request Oct 14, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant