Skip to content

Commit 2e529e0

Browse files
authored
Change HS256 to HS512, and remove JSON example
1 parent b126a2d commit 2e529e0

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

decode.php

+2-10
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66
$key = '83aeee518617ad6f3393bf0685e37d3e';
77

88
// plain text
9-
$token='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.IkhlbGxvLCBXb3JsZCEi.XYtTUc2xhYATDmvY0cDzCREb-uplZf03Rq1sMFhweA4';
10-
$decode = JWT::decode($token, $key, array('HS256'));
9+
$token='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.IkhlbGxvLCBXb3JsZCEi.evA2B8m545JM5epoHgmBIA_Qy6W3CMHcoHhR6LHFkHjmEPp7zDtIbZCqf3hTjZNfLNKghKSdNmfOF6sRMuXmIA';
10+
$decode = JWT::decode($token, $key, array('HS512'));
1111
print $decode."\n";
12-
13-
// JSON
14-
$token='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.IntcInN0YXR1c1wiOlwic3VjY2Vzc1wiLFwiZGF0YTFcIjpcInRlc3QxXCIsXCJkYXRhMlwiOlwidGVzdDJcIixcImRhdGEzXCI6XCJ0ZXN0M1wiLFwiZGF0YTRcIjpcInRlc3Q0XCIsXCJkYXRhNVwiOlwidGVzdDVcIn0i.lTHo7zbetlA2su017EVukpSzL1Zj60k7mEZZHxAlz7k';
15-
$decode = JWT::decode($token, $key, array('HS256'));
16-
print $decode."\n";
17-
$object=json_decode($decode);
18-
print_r($object);
19-
print "\n";

0 commit comments

Comments
 (0)