M
M
Mors Clamor2019-09-13 19:02:08
API
Mors Clamor, 2019-09-13 19:02:08

Laravel rest api user registration and authorization, do I need built-in tools?

Hello. I am making a RESTful API on Laravel, it already has Eloquent, and REST tools, which is very convenient. In fact, I need the following functionality from the API server
The client part of the site makes a request to its server -> the server makes a request to api -> api server adds data to the database / retrieves data from the database and returns a response in JSON format -> server something with does this data. That is an API for internal use.

  1. Is authorization required for such an API?
  2. Do I need built-in authorization and user registration tools? I can’t understand how they work, but everything is tied to sessions
  3. Can I just delete the Auth folder if I don't need the standard tools?

PS on the server with the site is not using Laravel
Thank you in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JhaoDa, 2019-09-13
@JhaoDa

1. This is up to you to decide, but is usually required. Or maybe the application and the server work with each other over a closed channel, in the internal network, then it is not necessary. In any case, the question is not for us.
2. No. The API, of course, can be done in sessions, but they beat their hands for this. OAuth2 is suitable for authentication / authorization during client-server, server-server interaction, Laravel has a ready-made package -  Passport .
3. Yes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question