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

How to set "enable_granular_consent" parameter on Client.php? #2581

Open
ninsky opened this issue Mar 20, 2024 · 4 comments
Open

How to set "enable_granular_consent" parameter on Client.php? #2581

ninsky opened this issue Mar 20, 2024 · 4 comments

Comments

@ninsky
Copy link

ninsky commented Mar 20, 2024

I've got an email from Google telling me that users of my Google Client (created before 2019) will get displayed a granular consent screen from June 2024. Therefore I need to set the "enable_granular_consent" parameter on the Google Client. This parameter is set by default for newer Google Client IDs according to google developers doc.

Now I've checked the most current version of the Client.php and it seems that there is no such function to set this parameter. Any idea how I could fix this or whether this function will be added to the Client.php soonish?

Thanks in advance
Nino

@ninsky
Copy link
Author

ninsky commented Mar 20, 2024

I was able to set the parameter on createAuthUrl().

@alebedev80
Copy link

@ninsky please provide code snippet

@ninsky
Copy link
Author

ninsky commented Mar 22, 2024

Here we go:
return $this->googleClient->createAuthUrl([Google_Service_Oauth2::USERINFO_PROFILE, Google_Service_Oauth2::USERINFO_EMAIL], ['enable_granular_consent' => 'true']);

@alebedev80
Copy link

I've created PR

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

2 participants