DEV Community

vickyktk
vickyktk

Posted on

Please help

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โ€ฆ

Top comments (4)

Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

Welcome to DEV.

Although the community is usually happy to help (see the #help tag), we recommend posting more than just an embedded StackOverflow question. We don't want DEV to become a heap of links. ;)

From the Terms of Use:

Users must make a good-faith effort to share content that is...not designed primarily for the purposes of promotion or creating backlinks. Additionally, posts must contain substantial content โ€” they may not merely reference an external link that contains the full post.

After editing your post, I also recommend adding some tags, especially for the related technologies. It'll help your post get noticed.

Thanks, and welcome!

Collapse
 
vickyktk profile image
vickyktk

Thanks ,I will try my best to post according to the rules.

Collapse
 
moopet profile image
Ben Sinclair

Your prompt appears to be set to auto' with an extra single quote. Have you tried removing it or adding a matching opening quote?

Collapse
 
vickyktk profile image
vickyktk

I tried to set prompt to many other values like consent, force,select_accept but nothing worked