Skip to content

ikool-cn/appstoreconnectapi-php-jwt-sign

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

App Store Connect API JWT ES256 Signature For PHP

Usage

require './ECSign.php';

$key = <<<EOF
-----BEGIN PRIVATE KEY-----
YOUR p8 KEY File Content
-----END PRIVATE KEY-----
EOF;

$header = [
    'alg' => 'ES256',
    'kid' => '<Your Kid>',
    'typ' => 'JWT',
];

$payload = [
    'iss' => '<YOUR Issuer ID>',
    'exp' => time() + 600,
    'aud' => 'appstoreconnect-v1'
];

$token =  ECSign::sign($payload, $header, $key);
echo $token;

Run Test

curl -v -H 'Authorization: Bearer <YOUR TOKEN>' "https://api.appstoreconnect.apple.com/v1/apps"

About

App Store Connect API JWT ES256 Signature For PHP

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages