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

andyjh07's avatar

One login for multiple sites

Hey friends,

I've got a couple of apps I'm building on Laravel. They are all going to be separate systems, likely on separate servers but part of one "ecosystem". I have a goal of allowing people to sign up on any of the sites that I create, and that login can then be used on any of the other sites.

Is this the sort of thing Passport is used for? If so, what's the best way to implement it? Should I pick just one site and make that the "main" user database, or spin up a single app just for holding all the user data?

Thanks in advance for your feedback/ideas,

Andy

0 likes
5 replies
SaeedPrez's avatar

Haven't tried this but doesn't the remember me work if you share the users table and set the cookie for multiple domains? Or maybe you could get the remember_me token and send it to the login server and then use auth()->login($userId) if all is good.

andyjh07's avatar

But if you go to another one of the sites (where no login session exists), how would you login?

andyjh07's avatar

@ssuresh yeah, that's exactly the same situation. I think that's what Passport allows to do now so I'll be looking into that I think. Thank you :)

oliverkuchies's avatar

|'ve just created this toolkit for Laravel and if its not too late i'd love for you to try it :)

It'll allow you to use multiple logins for different apps.

OneLogin Laravel PHP Toolkit

Very easy setup. Cheers!

Please or to participate in this conversation.