diff --git a/src/API/Authentication.php b/src/API/Authentication.php index 7dcb65c7..64727abe 100644 --- a/src/API/Authentication.php +++ b/src/API/Authentication.php @@ -262,6 +262,10 @@ public function oauth_token($options = []) { $options['client_id'] = $this->client_id; } + if (! isset($options['client_secret'])) { + $options['client_secret'] = $this->client_secret; + } + if (! isset($options['grant_type'])) { throw new ApiException('grant_type is mandatory'); } diff --git a/src/JWTVerifier.php b/src/JWTVerifier.php index af1de095..e978d418 100644 --- a/src/JWTVerifier.php +++ b/src/JWTVerifier.php @@ -43,7 +43,7 @@ public function __construct($config) { } if (isset($config['suported_algs'])) { - throw new Exception("`suported_algs` was properly renamed to `supported_algs`."); + throw new CoreException("`suported_algs` was properly renamed to `supported_algs`."); } if (!isset($config['supported_algs'])) { @@ -90,7 +90,6 @@ public function __construct($config) { */ public function verifyAndDecode($jwt) { - $tks = explode('.', $jwt); if (count($tks) != 3) { throw new InvalidTokenException('Wrong number of segments');