PHP code example of slepic / apple-sign-in-client-secret-generator
1. Go to this page and download the library: Download slepic/apple-sign-in-client-secret-generator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
slepic / apple-sign-in-client-secret-generator example snippets
use Slepic\AppleSignInClientSecretGenerator\AppleSignInClientSecretGenerator;
$clientId = 'com.example.TESTAPP';
$teamId = 'FOO123BAR456';
$keyId = '654RAB321OOF';
$certPath = __DIR__ . '/certificate.p8';
$privateKey = \file_get_contents($certPath);
$clientSecret = new AppleSignInClientSecretGenerator();
echo $clientSecret->generate($clientId, $teamId, $keyId, $privateKey);