Single login redirects to different apps

I’m using Django for my auth0 app. I have 2 test apps in auth 0 and I have 2 Django apps running on separate ports - 5000 and 5001 they login to their respective apps. They are authenticating users correctly separately. But I want it so that there is just one login page and depending on username they’re redirected to a certain auth 0 app. What would I do for that?
I have been looking at universal login - just unsure how to implement that. And I’ve also seen a few things about lock - but I’m not 100% sure about how to implement either of these and which one is a better solution

2 Likes

Hi @avani.bhatnagar,

You should be able to do this pretty easily. What flow are you using? Auth Code? Do you have different applications defined in Auth0 for your apps? Each application has its own callback URL.

Provide some more detail and we can help out.

John

1 Like

Hi @john.gateley,

I don’t believe I followed any “flow”. Please guide me if there’s one you recommend.
I defined two different applications in Auth0 (App1 and App2) and I followed the quickstart guides to set up my Django apps for both (both running on different ports locally). I have the callback URLs defined separately for both apps in auth0: http://localhost:3000/complete/auth0 and http://localhost:3001/complete/auth0.

When I go to localhost:3000 the Auth0 login page shows for App1 and it authenticates as expected and when I go to localhost:3001 the Auth0 login page for App2 shows up and it works fine as well. But ideally I want one “centralized login” page to show up - for all applications. Are there different steps to follow?

I would really appreciate any help! Thanks a lot.
Avani

1 Like

Hi @avani.bhatnagar

Flow docs are here:

I think, with Django quickstart, you are using AuthCode.

I think you are using a centralized login page, it just has parameters for the name of the application. Try changing your ULP. See docs here:

John

1 Like

@john.gateley

Thanks for the response! So you’re saying if I just run one of my Django web apps locally (I have two defined in Auth0) and change the name of application in the universal login - then it should take me to all applications? Even if I have client ids and secrets for only one of the apps in my Django app?

This is what is happening right now:
I have two web apps defined in Auth0 and when I have one web app (configured with Test App 1) running then only users whitelisted for that app can login and it says ‘access denied’. I want it to redirect it to another app (Test app 2) when the user doesn’t have access to Test App 1 but has access to Test App 2.

Just trying to figure this out - this is my first time working with Auth0. Really appreciate all the help!

1 Like

@john.gateley I changed my approach a little bit. What I’m trying to achieve now is this - I have two auth0 applications: App 1 and App 2 - both using different connections: Connection1 and Connection2. I have two types of users: User1 and User 2. I will set it up so that User 1 for connection 1 and user 2 for connection 2. In this case, how would I set up an app that when a user logs in they’re redirected to App 1 if they’re user 1 and redirected to App 2 if they’re user 2.

Would appreciate any suggestions.