Skip to content

Commit d137805

Browse files
committed
Update README to reflect newly-required algorithms arguments
1 parent ffed276 commit d137805

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@ $token = array(
2727
"nbf" => 1357000000
2828
);
2929

30-
/*
31-
IMPORTANT
32-
HS256 is actually the default, but you should set it explicitly
33-
if you intend to use another strategy (e.g. RS256):
34-
*/
35-
JWT::setOnlyMethodAllowed('HS256');
36-
30+
/**
31+
* IMPORTANT:
32+
* You must specify supported algorithms for your application. See
33+
* https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40
34+
* for a list of spec-compliant algorithms.
35+
*/
3736
$jwt = JWT::encode($token, $key);
38-
$decoded = JWT::decode($jwt, $key);
37+
$decoded = JWT::decode($jwt, $key, array('HS256'));
3938

4039
print_r($decoded);
4140

0 commit comments

Comments
 (0)