Generate, read and validate JWT tokens.
First import the JWT.php
into your PHP project.
import_once 'JWT.php';
Generate a new token from a payload array
JWT::generateToken([
'iss' => 'localhost',
'exp' => '12031032123'
'name' => 'User',
'email' => 'a@a.com'
])
Check if a received token is valid
JWT::isTokenValid($receivedToken)
Retrieve the received token payload
$payload = JWT::getPayload($receivedToken)