Answer the question
In order to leave comments, you need to log in
How to properly implement JWT in PHP?
All the best time of the day. Please explain how JWT works. How much I read, I just can not understand the whole picture. There are ready-made examples on github, but I don’t want to use them without understanding.
As I see it:
1) The user sends a login and password to the server
2) They are checked in the database, if they match - the server generates a token of the form HEADsdfsfddsf.PAYLOADsdfsfsfs.SIGNATUREsdfslqeqa
3) The token is stored in LocalStorage or other storage from the user + in the database
4) Each time when a request is made to the server, a token from LS is added to it
5) The server checks the token from the user and the database. If everything is good - gives the rights.
Do I understand correctly? Maybe somewhere there is detailed information about the principle of implementation in Russian? Preferably without binding to frameworks.
Thanks in advance for your reply.
Answer the question
In order to leave comments, you need to log in
The server checks the token from the user and the database.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question