I’m using Nowakowskir adhocore JWT PHP library from JWT.io to generate the token:
GitHub - adhocore/php-jwt: Ultra lightweight, dependency free and standalone JSON web token (JWT) library for PHP5.6 to PHP8.0. This library makes JWT a cheese.
$header = array();
$header['alg'] = 'HS256';
$header['typ'] = 'JWT';
$pload = array();
$pload['iss'] = API_KEY;
$pload['exp'] = time() + 3600;
$tokenDec = new Nowakowskir\JWT\TokenDecoded($header,$pload);
$tokenEncoded = $tokenDec->encode(API_SECRET,'HS256');
return $tokenEncoded->toString();
The Token apparently generates fine, but when trying to establish an API connection I get an error that the token its Invalid.
{“code”:124,“message”:“Invalid access token.”}
Any idea where its going wrong?
Any help would be appreciated.