No client id specified / authentication failed (Set Extension Required Configuration)

Ok, so fixed the issue with client id… this was fixed by adding &client_id as query parameter.

Next Problem… Seems my earlier luck with the JWT authentication was a failure.

My new error response:
{“error”:“Unauthorized”,“status”:401,“message”:“authentication failed”}

Language: PHP
Engine: Firebase JWT (https://github.com/firebase/php-jwt)

PHP Code
Below is the JWT code used to generate a signature…
public function auth($userId) {
$payload = array(
“exp” => (int) time() + 60,
“user_id” => (string) ‘’.$userId.’’,
“role” => “external”,
);
return JWT::encode($payload, SystemConfig::$API_SECRET, ‘HS256’);
}