Search code examples
phpgoogle-oauthgoogle-php-sdk

Google Oauth2 authentication takes about 15 seconds


I am using google-php-api for authentication.

this takes most of the time just under 6 seconds, $client->authenticate($code);

this takes most of the time about 3 seconds, $token = $client->getAccessToken();

this takes most of the time just under 6 seconds too. $client->$data = $client->verifyIdToken($tokens->id_token)

Any idea why, or is it normal?


Solution

  • Forceing ipv4 hepled

    curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);