Index of /home/htscrtms/newcrm.htshah.com/hslider
<?php
require_once __DIR__ . '/lib/vendor/autoload.php';
use Google\Client;
$client = new Client();
$client->setApplicationName('Gmail API PHP');
$client->setScopes([Google\Service\Gmail::GMAIL_READONLY]);
$client->setAuthConfig('client_secret_313101685086-pvngafek8hae0qnlguplo1ujstkggg59.apps.googleusercontent.com.json'); // your actual file
$client->setRedirectUri('https://www.newcrm.htshah.com/authorize.php'); // 👈 add this
$client->setAccessType('offline');
$client->setPrompt('select_account consent');
if (!isset($_GET['code'])) {
$authUrl = $client->createAuthUrl();
header('Location: ' . filter_var($authUrl, FILTER_SANITIZE_URL));
exit;
} else {
$accessToken = $client->fetchAccessTokenWithAuthCode($_GET['code']);
file_put_contents('token.json', json_encode($accessToken));
header("Location: iceEmailExtract.php");
exit;
}
?>