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?

DaImTo
  • 88,623
  • 26
  • 153
  • 389
Nishanth G
  • 85
  • 2
  • 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) – 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
  • 4,918
  • 2
  • 19
  • 34