K
K
karpo5182019-10-11 14:43:24
Laravel
karpo518, 2019-10-11 14:43:24

How to set up a single interface for registration and authorization from a web application and mobile applications through Laravel Passport?

It is required to set up registration by phone number and authorization by it for the web application and subsequently for mobile applications. The web application will work through Vue, but will be isolated from Laravel as much as possible. We need a universal algorithm that does not need to be modified for applications by Laravel.
There is documentation for Laravel Passport, but it doesn't provide a general algorithm. What needs to be preconfigured? What should the application pass first and what should be done with it? And so everything is in stages. Can anyone break it down or send me a link to the manual? If there are several roles, is Laravel Passport suitable for these purposes?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
JhaoDa, 2019-10-11
@JhaoDa

Again fairy tales about documentation... What other "general algorithm" are you waiting for? It clearly says what you need to pre-configure (install Passport, create the desired client, with the password type, in this case), how to get a token (by passing the login / password) and how to send it from the front back to the back (in the header, for example). ALL!
It has nothing to do with Passport registration.
It also has nothing to do with Passport roles, but partially similar behavior can be implemented through scopes.

N
NubasLol, 2019-10-11
@NubasLol

Use jwt token for authorization. Write your own guard who will authorize the user on it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question