From a922a27d06f9eb11b885170dbca3b1d80e782fbd Mon Sep 17 00:00:00 2001 From: devnick Date: Thu, 9 Apr 2015 16:17:12 -0500 Subject: [PATCH] php-jwt algorithm support Added support for allowing the JWT algorithm to be passed into Auth0's decode method, which is now required by php-jwt --- src/Auth0/Login/Auth0Service.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Auth0/Login/Auth0Service.php b/src/Auth0/Login/Auth0Service.php index 25a31089..28afa344 100644 --- a/src/Auth0/Login/Auth0Service.php +++ b/src/Auth0/Login/Auth0Service.php @@ -60,14 +60,14 @@ public function callOnLogin($auth0User) { } private $apiuser; - public function decodeJWT($encUser) { + public function decodeJWT($encUser, $jwtArray = []) { $secret = Config::get('auth0::api.secret'); $canDecode = false; try { // Decode the user - $this->apiuser = \JWT::decode($encUser, base64_decode(strtr($secret, '-_', '+/')) ); + $this->apiuser = \JWT::decode($encUser, base64_decode(strtr($secret, '-_', '+/')), $jwtArray); // validate that this JWT was made for us if ($this->apiuser->aud == Config::get('auth0::api.audience')) { $canDecode = true;