I am relatively new to Auth0 but have experience building identity services. I am trying to do something that seems simple but I am struggling with the impl.
In our nodejs express multi-tenant app, I would like to expose an endpoint like /customer/:name/login that will redirect the user to their Auth0 Organization login page. I already have Organizations configured. In our database, we will associate customer name with organization ID, so I have access to the Auth0 org ID on the server. The flow I want is GET /customer/:name/login
→ look up org ID → redirect to Auth0 login → redirect to app callback page.
The Auth0 documentation refers to calling the authorize
endpoint but delegates the details to an Auth0 SDK. I looked at these libraries:
-
passport-auth0
: I am not excited about the session requirement when usingpassport-auth0
; this is a new dependency our app does not currently have. -
express-openid-connect
: Simpler than passport config, and also handles the session requirement by storing state in encrypted cookies. This blog suggests preferringexpress-openid-connect
for new projects as a replacement forpassport-auth0
; however, I can’t find a way to specify an organization ID toexpress-openid-connect
.
I feel like I’m overcomplicating this; can you help clarify which library would be better for my use case and provide any implementation tips?