3

I'm setting up around 4 Laravel 5.3 based apps at the moment, they are all part of one "ecosystem".

I plan to use a central Laravel app that will handle any user signup, user login and also hold all user details. These details will be used across the 4 separate Laravel web apps. I may also use these user details inside mobile apps in the future so I assume i'll need some sort of JWT based system to control this.

I've thought about using Laravel Passport to achieve this but I don't think this will work for this scenario. In all honesty, the documentation is not clear to me whether this is the sort of system it is designed for or if I need to use a different oAuth2 system. My understanding is it is for API authentication only, or am I wrong?

All my other Laravel apps will be on different servers so I can't share the database unfortunately. I need to implement a cross domain solution it seems.

Thanks in advance for any info on this, just to clarify that I am not asking you to code the script for me, simply to help point me in the right direction on how to do this properly - can't really show code on something I don't know!

I believe I have explained everything that I am trying to achieve here, and I have already done research but nothing seems to be clicking in my brain.

2
  • Why the downvote? I've done research, presented my findings and asking for help... Could at least leave a reason, sigh Commented Oct 11, 2016 at 11:48
  • @Epodax I'm not sure how it's so broad? Passport allows for OAUTH2 server to be set up, which sounds like the right thing to do, however I don't believe it suits this project as my users will use a web app primarily, and then mobile apps later on down the line. So my question is basically asking if there is a good way to utilise a central laravel app that contains all the users (the main site) and have the other servers speak to that to get the user data Commented Oct 11, 2016 at 11:59

1 Answer 1

2

I think it depends on your business logic. Below is what i'm thinking:

  1. If what you mean Multi Domains is the sub domains (as you mentioned login.site.com), i think the simplest way is to use site.com wide cookie with redis/memcached as the session storage solution.
  2. If they do have different domain names, and beyond the central site, user when visit site A also want site B feature (or content, those sites are closely connected), i thought the JWT solution is the better choice.
  3. Any other cases, choose OAuth

Well, maybe others have better ideas.

1
  • That's a good answer and makes sense. It's likely that I will have one central site like this maincompany.com where user data, user sign up and user register will be handed, and then the multi apps that are part of this umbrella are separate servers/domains like app1.com, app2.com and app3.com all hosted on different Laravel Forge deployed servers. Looks like I'll probably go with option 2, at least until i've explored Passport's complete capabilities :) Commented Oct 11, 2016 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.