Skip to content

Latest commit

 

History

History
32 lines (18 loc) · 932 Bytes

README.MD

File metadata and controls

32 lines (18 loc) · 932 Bytes

Class php jwt token generator

php class to generate and validate jwt tokens.

Run

to execute the project

docker-compose up

PHP Jwt

first instantiate the object passing the secret key to the class constructor to generate the token signature.

Alt text

the object instance has access to the generate method where you pass the payload and generate the token.

Alt text

the generate method's answer is this:

Alt text

you also have access to the decode method, where it validates the signature and returns if the token is valid

Alt text

the response of the decode method is equal to:

Alt text