SAML SSO with Passport.js in Express + Better-Auth
Express🤔Question
Hi everyone I’m building an Express.js application and want to implement SAML-based SSO. Since SAML support in Better-Auth is still in the dev phase, I’m planning to use Passport.js (passport-saml) for SAML authentication and then integrate it with Better-Auth for user/session management.
Has anyone already done this in an Express setup? If yes, I’d really appreciate guidance on:
How you hand off the validated SAML user from Passport to Better-Auth
How you handle user creation/mapping in Better-Auth
How sessions or tokens are generated after SAML login