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'
here is the config for 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);
i tried setting up approval_prompt or prompt both but it isn't working if i leave these two unset still i get invalid parameter 'prompt=auto'
It is a mistake in official web. You need set:
$gClient = new Google_Client();
$gClient->setPrompt('consent');
Via merged pull-request in documentation https://github.com/googleapis/google-api-php-client/pull/1796
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With