PHP code example of neoan3-apps / stateless
1. Go to this page and download the library: Download neoan3-apps/stateless library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
neoan3-apps / stateless example snippets
// static
Neoan3\Apps\Stateless::setSecret('My-super-secure-Key');
// or as object
// (method names are the same as static calls)
$stateless = new Neoan3\Apps\StatelessOOP('my-secure-key');
// create JWT
$jti = 'someId';
$scope = ['read', 'write'];
$payload = ['additional'=>'info']; // optional
$jwt = Neoan3\Apps\Stateless::assign($jti, $scope, $payload);
// validate JWT
try{
$decrypted = Neoan3\Apps\Stateless::validate();
$user = $decrypted['jti'];
} catch(Exception $e) {
die('ups');
}