Skip to content

Instantly share code, notes, and snippets.

@tecnom1k3
Last active August 29, 2015 14:06
Show Gist options
  • Save tecnom1k3/76863714a5dfba39d1a0 to your computer and use it in GitHub Desktop.
Save tecnom1k3/76863714a5dfba39d1a0 to your computer and use it in GitHub Desktop.
jwt php
{
"name": "technomike/jwt",
"authors": [
{
"name": "technomike",
"email": "tech@no.mi"
}
],
"require": {
"firebase/php-jwt": "*"
}
}
<?php
chdir(dirname(__DIR__));
require_once('vendor/autoload.php');
$key = "example_key";
$token = array(
"iss" => "http://example.org",
"aud" => "http://example.com",
"iat" => 1356999524,
"nbf" => 1357000000
);
$jwt = JWT::encode($token, $key, 'HS512');
echo $jwt;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment