I am working with JWT token with algorithm ES256 using PHP to check devices for IOS And successfully create JWT (JSON web token) for it.
I have tried to call API for device check through the postman API: https://api.development.devicecheck.apple.com/v1/query_two_bits
require 'vendor/autoload.php';
use Lcobucci\JWT\Builder;
use Lcobucci\JWT\Signer\Key;
use Lcobucci\JWT\Signer\Ecdsa\Sha256;
$signer = new Sha256();
$privateKey = new Key('file:///AuthKey_*****.p8');
$time = time();
$token = (new Builder())->issuedBy('**********')
->issuedAt($time)
->setHeader('kid', '*********')
->getToken($signer, $privateKey);
I have successfully created a JWT token from the above code,
API: https://api.development.devicecheck.apple.com/v1/query_two_bits
But when I pass this token in authorization bearer in above API I am getting below error.
Unable to verify authorization token
Is there any error while creating an authentication file?