PHP code example of pmingram / php-apple-signin

1. Go to this page and download the library: Download pmingram/php-apple-signin 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/ */

    

pmingram / php-apple-signin example snippets



use AppleSignIn\ASDecoder;
// ASAuthorizationAppleIDCredential credential
$clientUser = "example_client_user"; //credential.user
$identityToken = "example_encoded_jwt"; // credential.identityToken

$appleSignInPayload = ASDecoder::getAppleSignInPayload($identityToken);

/**
 * Obtain the Sign In with Apple email and user creds.
 */
$email = $appleSignInPayload->getEmail();
$user = $appleSignInPayload->getUser();

/**
 * Determine whether the client-provided user is valid.
 */
$isValid = $appleSignInPayload->verifyUser($clientUser);

bash
composer