Dynamic hostname for Custom Database

I’ve currently got a requirement for users to login using MFA via the auth0 API. We’ve got built in authentication in our app so I’d be using a custom db login script to authenticate the user via our app first before we can proceed with MFA and auth0.

This setup is working fine with a static hostname but the problem is we’ve got a multi-tenant setup at our end meaning that users would come from different domains. My question therefore is, how can I route the authentication to the correct application via the login script? i.e example.acme.com, anotherexample.acme.com

One thing I’ve read about is using auth0-forwarded-for in the header and then using the IP’s which will be perfect however, I’m not sure how to access that header value once the request hits the login script from my application. Any ideas?

Not sure if this helps, or if it works in a multi-tenant scenario, but you have the client name / client ID available to you. You can identify applications by client ID / name assuming you give each app its own client.

that was one thought but how do I get those details from within the script?

Hey there!

Sorry for such delay in response! We’re doing our best in providing the best developer support experience out there, but sometimes the number of incoming questions is just too big for our bandwidth. Sorry for such inconvenience!

Do you still require further assistance from us?