Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ivymasterman's avatar

How to do one login process, for multiple apps?

So, I have 3 apps, that all have users tables in their respective databases.

One of these 3 apps is the main one, which links to the other 2, but the other 2 can also be used separately.

Is there a way to log into the main app, and automatically also get logged into the other 2? They will not be on the same domain, but the users' table will have the same data between these 3.

If this is not possible, would putting them in the same domain help?

If you can suggest some other architecture, pls do so.

0 likes
2 replies
fylzero's avatar
fylzero
Best Answer
Level 67

@ivymasterman The best thing I can tell you to do is pull on the thread of SSO. Single sign-on is the pattern you are describing. I believe there are packages out there for Laravel (assuming that is what you are using) to make this a bit easier.

1 like
ivymasterman's avatar

@fylzero Thank you, never heard of it. I spent my time Setting up Laravel passport and Socialite. What I amounted up to is logging a single user via one app, to other apps.

But, is there a way to use one client for multiple users?

For now, I need to send the clientID and clientSecret any time I want to Approve a User. But it turns out the client is only tied to one user. How to use one client for multiple users. If that is not possible, what can I do for this issue. Any tip pls.

Please or to participate in this conversation.