diff --git a/classes/core_jwt_manager.php b/classes/core_jwt_manager.php index eb6a114..0fd08ea 100644 --- a/classes/core_jwt_manager.php +++ b/classes/core_jwt_manager.php @@ -19,6 +19,7 @@ namespace auth_jwt; require_once(__DIR__ . '/../vendor/autoload.php'); use \Firebase\JWT\JWT; +use \Firebase\JWT\Key; /** * Key manager class. @@ -96,7 +97,7 @@ class core_jwt_manager $secret = $this->config->jwtsecret; try { - $decoded = JWT::decode($keyvalue, $secret); + $decoded = JWT::decode($keyvalue, new Key($secret, 'HS256')); } catch (\Exception $e) { throw new \moodle_exception('invalidkey'); }