PHP code example of xxtime / oauth-client

1. Go to this page and download the library: Download xxtime/oauth-client 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/ */

    

xxtime / oauth-client example snippets


$id = '{Google account id}';
$token = '{Google login account token}';
$option = [
    'clientId' => '{Google app id}'
];
try {
    $oauth = new OauthAdaptor('google', $option);
    $user = $oauth->verify($id, $token);
    print_r($user);
} catch (\Exception $e) {
    echo $e->getMessage();
}