PHP code example of guanhui07 / apple-sign-in-php-sdk
1. Go to this page and download the library: Download guanhui07/apple-sign-in-php-sdk 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/ */
guanhui07 / apple-sign-in-php-sdk example snippets
$validationData = new ValidationData();
$validationData->setIssuer('https://appleid.apple.com');
$validationData->setAudience('com.azimo');
$appleJwtFetchingService = new Auth\Service\AppleJwtFetchingService(
new Auth\Jwt\JwtParser(new Parser()),
new Auth\Jwt\JwtVerifier(
new Api\AppleApiClient(
new GuzzleHttp\Client(
[
'base_uri' => 'https://appleid.apple.com',
'timeout' => 5,
'connect_timeout' => 5,
]
),
new Api\Factory\ResponseFactory()
),
new \Lcobucci\JWT\Signer\Rsa\Sha256()
),
new Auth\Jwt\JwtValidator($validationData),
new Auth\Factory\AppleJwtStructFactory()
);
$appleJwtFetchingService->getJwtPayload('your.identity.token');