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

Add FedCM - Google Login being blocked due to third-party cookies #157

Closed
faeldray opened this issue Jul 24, 2024 · 3 comments
Closed

Add FedCM - Google Login being blocked due to third-party cookies #157

faeldray opened this issue Jul 24, 2024 · 3 comments

Comments

@faeldray
Copy link

We have several WP sites that I've recently begun using this plugin on because the company uses Google for our accounts and it just makes logging in much easier. Everything has been going fine until one user and myself began getting the error "Invalid Google credentials provided" when we tried to log in, despite just logging into our Google accounts and being able to access email and such just fine. While trying to diagnose the issue, I noticed in the address bar of a private window that there was a notification saying that third-party cookies were being blocked. Once I allowed third-party cookies, I was able to log in without issue.

My best guess is that this is caused by Chrome's progressive removal of third-party cookies, which they began rolling out earlier this year (I'm using Vivaldi, an offshoot of Chrome). Which would explain why some users are experiencing the issue but not all.

It appears that the solution is to migrate to the FedCM API. So if that's something that could be implemented, that would be greatly appreciated, because I imagine the issue is going to get even more prevalent.

@figureone
Copy link
Member

Thanks, we'll take a look at FedCM and see if we can switch over to it. We're using the official Google PHP API to integrate with Google, so hopefully it's pretty straightforward.
https://github.com/googleapis/google-api-php-client

@figureone
Copy link
Member

Reading up on Google's FedCM docs, it looks like they intend to automatically transition everyone to FedCM. But we can test forcing the behavior in Authorizer to catch the edge cases you are experiencing.

Can you try patching the Authorizer source to include the FedCM flag and let us know if that resolves the errors you are seeing in Vivaldi? Specifically, add this:

    data-use_fedcm_for_prompt="true"

As an attribute to div#g_id_onload here: https://github.com/uhm-coe/authorizer/blob/master/src/authorizer/class-login-form.php#L190

@figureone
Copy link
Member

Aloha @faeldray, checking in whether adding data-use_fedcm_for_prompt="true" solved the issues you were seeing with third-party cookie blocking in the Vivaldi browser.

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