假设我有以下代码
$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));
我有refresh token
有线下访问权限,当它调用
header('Location:'。filter_var($ auth_url,FILTER_SANITIZE_URL));
但它一次又一次地显示consent screen
询问用户权限,我在这里犯了什么错误?
答案 0 :(得分:0)
这是因为您的应用未经审核,请求OAuth开发人员验证转到https://support.google.com/code/contact/oauth_app_verification