Last active
August 29, 2015 14:06
-
-
Save tecnom1k3/76863714a5dfba39d1a0 to your computer and use it in GitHub Desktop.
jwt php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "technomike/jwt", | |
"authors": [ | |
{ | |
"name": "technomike", | |
"email": "tech@no.mi" | |
} | |
], | |
"require": { | |
"firebase/php-jwt": "*" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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