this is the error i am getting
400. That’s an error.
Error: invalid_request
Invalid parameter value for approval_prompt: 'auto'' is not valid
Request Details
response_type=code
access_type=offline
client_id=xyz-
xyx.apps.googleusercontent.com
redirect_uri=http://localhost/xyz/init/googleCallBack.php
state=scope=https://www.googleapis.com/auth/plus.me
approval_prompt=auto'
这是google login的配置
$gClient= new Google_Client();
$gClient->setAuthConfig('init/client_secret.json');
$gClient->setApprovalPrompt('consent');
$gClient->setApplicationName('abc');
$gClient->setAccessType('offline');
$gClient>setRedirectUri('http://localhost/xyz/init/googleCallBack.php';
$gClient->setScopes(Google_Service_Plus::PLUS_ME);
我尝试设置approval_prompt或提示两者但是如果我将这两个未设置仍然无效我仍然得到无效参数'prompt = auto'
答案 0 :(得分:2)
这是official web 中的错误。您需要设置:
$gClient = new Google_Client();
$gClient->setPrompt('consent');
通过文档中的合并拉取请求 https://github.com/googleapis/google-api-php-client/pull/1796