I Need a seamless login between two applications (nextjs and spring mvc) using same auth0 client

I Need a seems login between two applications (nextjs and spring mvc) using same auth0 client

My Scenario is I have 2 application on auth0 one with nextjs and another with java spring mvc which uses database based and password less auth(email) respectively.
I have setup cross origin access and I can see Java Session and nextJS session on cookies for both application.
What i want is when i login to nextjs or spring application I don’t want to login into another application.

Hi @vijay22uk,

Welcome to the Auth0 Community!

You can use Single Sign-On to log in across multiple clients. I would not recommend using a single client to represent two different applications as you’ve suggested.

SSO is enabled by default in new tenants, and the user should be able to log without providing credentials once a cookie session has been established for the Auth0 domain.

Hi @dan.woda Thanks for the reply.
These are 2 different application i.e different auth0 clients are being used and two sub domains.
And in allowed CORs for SSO both application i have added corresponding but I get login srceen.
Scenario -
I login into APP 1(nextjs and react)
I open APP 2(Java MVC) (It does’t use existing login/cookies and I have to login again).

Do they both navigate to the same domain for Auth? If so, the existing cookie session should allow the user to login without providing credentials.

For example, if I have appA on a.example.com and appB on b.example.com and they both redirect to auth.example.com to authorize (this is their auth0 domain), only the first login should require credentials.

You can test this using two of our quickstarts.

Yes they both(a. a.example.com and b b.example.com) goto same custom auth0 domain (auth.example.com). with different redirectURL and ClientID.
Also does this behaviour works on localhost port A and port B.

Custom Auth0 domain is example.auth0.com.

Sorry for the delay, I think I’ve found the issue.

If you are using two different connections (db and passwordless), the user can’t SSO because these are totally separate users.

Hi Dan,
Thanks for the clarification.

If we migrate/move another application to passwordless(email) will it work out of the box or something needs to be configured? Just need confirmation before changing the database to passwordless flow!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.