G
G
GrimJack2017-07-04 18:18:30
API
GrimJack, 2017-07-04 18:18:30

How to use laravel passport for restfull api?

There is a platform on laravel 5.4
Web version uses standard authorization
Now you need to add api for mobile applications
I read about laravel passport, but I can’t figure out how to use it
Let’s say I have a post route in routes/api.php like /auth/login
I want to pass when authorization login and password, and in response to receive two tokens (long-term and short-term)
And already work with them, and in controllers refer to the middleware for api
I read the documentation, but since English is not very good, I could not understand something
Please explain how do it right. I'm not asking you to do it for me.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene Pedya, 2017-07-14
@GrimJack

Somehow I translated for myself according to access rights in passport https://docs.google.com/document/d/1Agg8WbiAKP8vfm...
The technical side of the documentation is described quite well.
The main thing will be determined whether only your application or other third-party ones will have access.

A
Andy Developer, 2017-07-04
@UmbrellaCoders

for api it is better to use JWT https://github.com/tymondesigns/jwt-auth

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question