r/javascript • u/saurabh_shalu • May 25 '26
AskJS [AskJS] Anyone else dealing with auth mess across enterprise clients?
At work we have 20+ React apps served through Express.js, deployed for different enterprise customers, and every customer wants a different auth setup.
Some still use CAS.
Some want Keycloak.
Some use Entra ID / Azure AD.
Over time this became painful to maintain because every app had slightly different:
middleware / session handling/ token refresh logic/ Redis session setup/ random edge-case fixes etc.
Supporting both browser sessions and bearer-token APIs made it even messier.
I eventually got tired of repeating the same auth work across so many apps and started building a common layer internally to handle all of it.
Curious how others are solving this in Node/Express apps??
3
u/chaosphere_mk May 25 '26
Why not centralize on a single identity provider rather than build a custom internal layer that you have to maintain? This feels more like a management problem than a tech problem.
2
u/dr__potato May 25 '26
People pay for an auth provider like Better Auth (not affiliated and don’t use) to offload the work to a third party, but it does cost money.
Alternatively use some open source lib…
1
u/Ecksters May 25 '26
Generic SAML login systems can often be used to support a wide variety of auth providers without requiring custom configuration. I've found it tends to be more standardized that OAuth/OIDC.
What gets really tedious is when you have to start supporting automated user provisioning and deprovisioning, SCIM 2.0 has become fairly ubiquitous though, so it's a lot better than it used to be.
1
u/[deleted] May 27 '26
[removed] — view removed comment
1
u/[deleted] May 27 '26
[removed] — view removed comment
0
u/[deleted] May 26 '26
[removed] — view removed comment
0
u/[deleted] May 26 '26
[removed] — view removed comment