summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob DiMarco <rob@firebase.com>2015-04-01 11:19:55 -0700
committerRob DiMarco <rob@firebase.com>2015-04-01 11:19:55 -0700
commitd137805eeb4d7a2d1fee2be380c920b2210416ec (patch)
treeb72a4a444e7d4e7ecc46cf4c7975e5539dd39aef
parentffed2762ce8b949ea9477bf488adc26e905a249b (diff)
downloadphp-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.md15
1 files changed, 7 insertions, 8 deletions
diff --git a/README.md b/README.md
index 03ec673..1a9e093 100644
--- a/README.md
+++ b/README.md
@@ -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);