nicoorfi
10/18/2019 - 7:24 AM

Google OAuth

Google OAuth

Serve command:

$ php -S localhost:8000 -t examples/

Code

<?php
//example/index.php

require_once 'vendor/autoload.php';

$client = new Google_Client();
$client->setApplicationName("Client_Library_Examples");
$client->setDeveloperKey("YOUR_APP_KEY");

$accessToken = $client->fetchAccessTokenWithAuthCode('code');