PHP code example of nyan02 / kphp_oauth2_google

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

    

nyan02 / kphp_oauth2_google example snippets

$token = $provider->getAccessToken($grant, ['code' => $_GET['code']]);
$ownerDetails = $provider->getResourceOwner($token);