diff options
author | Rob DiMarco <rob@firebase.com> | 2015-04-01 11:19:55 -0700 |
---|---|---|
committer | Rob DiMarco <rob@firebase.com> | 2015-04-01 11:19:55 -0700 |
commit | d137805eeb4d7a2d1fee2be380c920b2210416ec (patch) | |
tree | b72a4a444e7d4e7ecc46cf4c7975e5539dd39aef | |
parent | ffed2762ce8b949ea9477bf488adc26e905a249b (diff) | |
download | php-jwt-d137805eeb4d7a2d1fee2be380c920b2210416ec.zip php-jwt-d137805eeb4d7a2d1fee2be380c920b2210416ec.tar.gz php-jwt-d137805eeb4d7a2d1fee2be380c920b2210416ec.tar.bz2 |
Update README to reflect newly-required algorithms arguments
-rw-r--r-- | README.md | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -27,15 +27,14 @@ $token = array( "nbf" => 1357000000 ); -/* - IMPORTANT - HS256 is actually the default, but you should set it explicitly - if you intend to use another strategy (e.g. RS256): -*/ -JWT::setOnlyMethodAllowed('HS256'); - +/** + * IMPORTANT: + * You must specify supported algorithms for your application. See + * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40 + * for a list of spec-compliant algorithms. + */ $jwt = JWT::encode($token, $key); -$decoded = JWT::decode($jwt, $key); +$decoded = JWT::decode($jwt, $key, array('HS256')); print_r($decoded); |