Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

i am getting this error Invalid parameter value for approval_prompt: 'auto'' is not valid

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'

like image 988
Brijesh kumar Avatar asked Oct 29 '22 22:10

Brijesh kumar


1 Answers

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

like image 192
grogsy Avatar answered Nov 14 '22 20:11

grogsy