In my web app I was able to get to the grant permissions for the business scope but now I just keep getting this invalid_grant error. I synced my clock to server time, and I cannot figure this out at all. Installing the `"google/apiclient": "^2.7"` composer package,
$credentials = __DIR__ . '/client_secrets.json';
$client = new Google\Client();
$guzzleClient = new \GuzzleHttp\Client(array( 'curl' => array( CURLOPT_SSL_VERIFYPEER => false, ), ));
$client->setHttpClient($guzzleClient);
$client->setAuthConfig($credentials);
$client->setAccessType("offline");
$redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
$client->setRedirectUri($redirect_uri);
$my_business_account = new Google_Service_MyBusinessAccountManagement($client);
if (isset($_GET['logout'])) { // logout: destroy token
unset($_SESSION['token']);
die('Logged out.');
}
if (isset($_GET['code'])) { // get auth code, get the token and store it in session
$client->authenticate($_GET['code']);
$_SESSION['token'] = $client->getAccessToken();
}
if (isset($_SESSION['token'])) { // get token and configure client
$token = $_SESSION['token'];
$client->setAccessToken($token);
}
if (!$client->getAccessToken()) { // auth call
$authUrl = $client->createAuthUrl();
header("Location: ".$authUrl);
die;
}
```
client_secrets.json:
```
{
"web": {
"project_id": "myid",
"client_secret": "mysercet",
"redirect_uris": [
],
"javascript_origins": [
]
}
}
```
Could it be the origin of my redirect?