N
N
Nick Bukovskiy2017-09-06 17:18:30
PHP
Nick Bukovskiy, 2017-09-06 17:18:30

How to write Rest api with post requests on slim?

The task is to write rest api. From the beginning, a login with a password comes with the post method and you need to log in or not the user, you also need to use tokens. Where can I read how to do it right? I understand how to write simple checks, but I don’t know about login. help me please

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fortop, 2017-09-06
@sonterix

For this, the authentication system on tokens is quite convenient.
For example JWT.
Accordingly, you have a certain user authentication point, where a token is issued to him.
For all other requests, you check for the presence of this token in the request and perform authorization.
Specifically for Slim, there is, for example, https://packagist.org/packages/tuupola/slim-jwt-auth

D
DrunkMaster, 2017-09-06
@DrunkMaster

The REST architecture assumes that requests are self-sufficient, i.e. does not imply the need for authorization.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question