i dont seem to get the refresh token when i call the access token? Here is the code:
$client = new Google_Client();
$client->setClientId($OAUTH2_CLIENT_ID);
$client->setClientSecret($OAUTH2_CLIENT_SECRET);
$client->setScopes('https://www.googleapis.com/auth/youtube');
$redirect = filter_var(URL,
FILTER_SANITIZE_URL);
$client->setRedirectUri($redirect);
$client->setApprovalPrompt("force");
$client->setState('offline');
var_dump($client->getAccessToken());
And this is what i get from it:
string(163) "{"access_token":"","token_type":"Bearer","expires_in":3599,"created":1111111111}"
Why dont i get the refresh token?