D
D
Dmitry Kuznetsov2019-09-07 14:37:55
User identification
Dmitry Kuznetsov, 2019-09-07 14:37:55

How to implement single registration and authorization on different sites?

Good afternoon. I ran into a problem when developing sites on Laravel. I have several sites for different projects. I want to combine all this into one domain. I assume that Laravel Passport will fit in this case.
The plan is as follows:
1. The site.ru domain will be the main one. User registration will take place there.
2. Domain game.site.ru. There will be another project, but connected to the site site.ru by users. On this site you can only log in. Registration will redirect to the site.ru site, where the user registers or logs in.
3. Domain game2.site.ru. The same site as game.site.ru, and with the same authorization.
PS: All domains (websites) have their own database, separate from the rest. So a single database cannot be used.
Do you think it is possible to do so? All sites will be written without JS frameworks (perhaps they will be rewritten later). What are the pitfalls you can "hit the little finger"? Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Wells, 2019-09-07
@dima9595

Passport won't work. It is suitable only for apishki, which will not be available with non-SPA (i.e. without js frameworks).
If everything is on the same domain - yes, you can. Cookie with a dot before the domain (session.domain config) and that's it.
There will be pitfalls when you want to add a third-party domain (site.ru && site.com) or switch to the same passport.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question