0

Lets say i have following code

    $state = 1234;
    $client = new \Google_Client();
    $client->setClientId('######');
    $client->stClientSecreet('####3');
    $client->addScope('https://www.googleapis.com/auth/youtube');
    $client->setState($state);
    $client->setAccessType("offline");       // offline access
    $client->setRedirectUri($redirect_uri);
    $client->refreshToken($decoded_refresh);

    $auth_url = $client->createAuthUrl();
    $client->setApprovalPrompt("auto");

    header('Location: '. filter_var($auth_url, FILTER_SANITIZE_URL));

i have refresh token with offline access,when it calls

header('Location: '. filter_var($auth_url, FILTER_SANITIZE_URL));

but it again and again show consent screen to ask user permission, what mistake i made here?

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
Nishanth G
  • 83
  • 4
  • 12
  • 1
    Possible duplicate of [How to refresh token with Google API client?](http://stackoverflow.com/questions/9241213/how-to-refresh-token-with-google-api-client) – Linda Lawton - DaImTo May 11 '17 at 06:28

1 Answers1

0

this because your app is unreviewed, to request OAuth Developer Verification go to https://support.google.com/code/contact/oauth_app_verification

uingtea
  • 6,002
  • 2
  • 26
  • 40