File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ Example
23
23
use \Firebase\JWT\JWT;
24
24
25
25
$key = "example_key";
26
- $token = array(
26
+ $payload = array(
27
27
"iss" => "http://example.org",
28
28
"aud" => "http://example.com",
29
29
"iat" => 1356999524,
@@ -36,7 +36,7 @@ $token = array(
36
36
* https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40
37
37
* for a list of spec-compliant algorithms.
38
38
*/
39
- $jwt = JWT::encode($token , $key);
39
+ $jwt = JWT::encode($payload , $key);
40
40
$decoded = JWT::decode($jwt, $key, array('HS256'));
41
41
42
42
print_r($decoded);
@@ -93,14 +93,14 @@ ehde/zUxo6UvS7UrBQIDAQAB
93
93
-----END PUBLIC KEY-----
94
94
EOD;
95
95
96
- $token = array(
96
+ $payload = array(
97
97
" iss" => "example.org",
98
98
"aud" => "example.com",
99
99
"iat" => 1356999524,
100
100
"nbf" => 1357000000
101
101
);
102
102
103
- $jwt = JWT::encode($token , $privateKey, 'RS256');
103
+ $jwt = JWT::encode($payload , $privateKey, 'RS256');
104
104
echo "Encode:\n" . print_r($jwt, true) . "\n";
105
105
106
106
$decoded = JWT::decode($jwt, $publicKey, array('RS256'));
You can’t perform that action at this time.
0 commit comments