Never getting a refresh token (2024)

I am unable to get a refresh token from Google. Notice I am using offline and force. But the token I get back has no refresh token. I thought , maybe its a token and refresh token all in one. But I cannot use that token to refresh the token.

$client = new Google_Client();
$client->setApplicationName("MYAPP");
$client->setClientId(GDRIVE_CLIENT_ID);
$client->setClientSecret(GDRIVE_CLIENT_SECRET);
$client->setRedirectUri($redirect_uri);
$client->addScope("https://www.googleapis.com/auth/drive");
$client->setAccessType('offline');
$client->setApprovalPrompt('force');

Array( [access_token] => ya29.a0AX9GBdUNfYtyMi098Yk.... [expires_in] => 3598 [scope] => https://www.googleapis.com/auth/drive [token_type] => Bearer [created] => 1674340315)

Never getting a refresh token (2024)
Top Articles
Latest Posts
Article information

Author: Reed Wilderman

Last Updated:

Views: 6725

Rating: 4.1 / 5 (72 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Reed Wilderman

Birthday: 1992-06-14

Address: 998 Estell Village, Lake Oscarberg, SD 48713-6877

Phone: +21813267449721

Job: Technology Engineer

Hobby: Swimming, Do it yourself, Beekeeping, Lapidary, Cosplaying, Hiking, Graffiti

Introduction: My name is Reed Wilderman, I am a faithful, bright, lucky, adventurous, lively, rich, vast person who loves writing and wants to share my knowledge and understanding with you.