Skip to content

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

Closed

Description

@faeldray

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.

Activity

  1. figureone commented on Jul 25, 2024

    @figureone
    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

  2. figureone commented on Aug 13, 2024

    @figureone
    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

  3. figureone commented on Sep 11, 2024

    @figureone
    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.

  4. added a commit that references this issue on Sep 25, 2024
    9fe6e31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions