Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid_request Invalid parameter value for approval_prompt: 'auto' is not valid #1821

Closed
garymg18 opened this issue Apr 21, 2020 · 11 comments
Closed
Assignees

Comments

@garymg18
Copy link

Environment details

  • OS: docker (Debian)
  • PHP version:
php -v
PHP 7.3.16 (cli) (built: Mar 31 2020 18:48:01) ( NTS )

Hello, I've a problem with GoogleLogin Extension for mediawiki which is using Your google-api-php-client. From today (yesterday there was no problem) we're getting this error from Google:

Authorization Error
Error 400: invalid_request
Invalid parameter value for approval_prompt: 'true' is not valid

When I changed the value from 'true' to force in Client.php (Client.php#L128) file it started to work. But is this value OK? Maybe this is some kind of bug and should be fixed in other way?

Thank You for Your answer

Best Regards,
Marcin

@kamyweb
Copy link

kamyweb commented Apr 21, 2020

The same on some our oauth applications
Environment details
OS: Amazon Linux/Docker (php:5.6-fpm)
PHP version:

php -v
PHP 5.6.40 (cli) (built: Jan 14 2019 21:32:25) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans

Package:
"google/apiclient": "^2.1",
but also with
"google/apiclient": "^2.4",

Authorization Error
Errore 400: invalid_request
Invalid parameter value for approval_prompt: 'auto' is not valid

also try with:
$client->setApprovalPrompt("consent");
with similar error

Authorization Error
Errore 400: invalid_request
Invalid parameter value for approval_prompt: 'consent' is not valid

@inogo
Copy link
Contributor

inogo commented Apr 21, 2020

Please use setPrompt method:
$google->setPrompt('consent');

More details in #1795

@kamyweb
Copy link

kamyweb commented Apr 21, 2020

It works, but I don't undestand why the same code yesterday works correctly...
Is there any changes on google api specs?

@abmcr
Copy link

abmcr commented Apr 21, 2020

Please use setPrompt method:
$google->setPrompt('consent');

More details in #1795

This solve the problem
Thank you

@bshaffer
Copy link
Contributor

Thank you everyone, great dialog. Thanks @inogo and @hugovk for chiming in. Im closing this issue but please comment or continue dialog if I missed anything.

@kamyweb
Copy link

kamyweb commented Apr 22, 2020

@bshaffer don't you think is required to change the default value of Prompt from 'auto' to 'none' or empty as documentated on this site https://developers.google.com/identity/protocols/oauth2/openid-connect#authenticationuriparameters ?

@jkanape
Copy link

jkanape commented Apr 23, 2020

I think default value of 'prompt' is empty string already:
https://github.com/googleapis/google-api-php-client/blob/master/src/Google/Client.php#L122

But maybe 'approval_prompt' should be changed? (even Google seems to accept 'auto' again)

@hugovk
Copy link

hugovk commented Apr 23, 2020

Looks like Google have now fixed it, but approval_prompt isn't in the docs so I believe it probably makes sense to change it. We're keeping the change in our library.

@TheCrowned
Copy link

@bshaffer This page still recommends setApprovalPrompt('consent'), which results in a bad request:
https://developers.google.com/identity/protocols/oauth2/web-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants