$client = new Google_Client(); $client->setClientId(''); $client->setClientSecret(' '); $client->setRedirectUri(' '); $client->setScopes(['email', 'profile']); $authUrl = $client->createAuthUrl();
$client = new Google_Client(); $client->setClientId('In this example, we pass in the optional parameters of access_type and approval_prompt, which will request offline access and force a user consent prompt each time respectively. The package library used in these examples is the Google PHP client library.'); $client->setClientSecret(' '); $client->setRedirectUri(' '); $client->setScopes(['email', 'profile']); $authUrl = $client->createAuthUrl([ 'access_type' => 'offline', 'approval_prompt' => 'force' ]);