MomenSherif / react-oauth

Google OAuth2 using the new Google Identity Services SDK for React 🚀
https://www.npmjs.com/package/@react-oauth/google
MIT License
1.13k stars 141 forks source link

Adopting FedCM regarding Chrome blocking third party cookies in future. Seeing warnings: Chrome will block third party cookies #333

Open rjtbansal opened 9 months ago

rjtbansal commented 9 months ago

Firstly thanks for this awesome library! I am using it for Google SSO on our web app.

Do we plan to make tweaks to the library for adopting FedCM https://developers.google.com/identity/gsi/web/guides/fedcm-migration?

Here's the Google docs that talk about third party cookies https://developers.google.com/identity/gsi/web/guides/supported-browsers#third-party_cookies

Here's the migration guide: https://developers.google.com/identity/gsi/web/guides/fedcm-migration#migrate_your_web_app

As an example below the screenshot I see when Google icon loads using this library: image

MuhammadAakash commented 8 months ago

I have also received an email from Google to migrate to the FedCM over my website. I am using this library for the Google sign-in, and One Tap Sign in feature.

MuhammadAakash commented 8 months ago

@MomenSherif I'm interested in contributing to this excellent library. Could you please guide me a little bit on how to address this current issue? And I'm unable to find any references on how to set up the project and contribute to it.

Thanks

VaibhavTessell commented 7 months ago

@rjtbansal @MuhammadAakash I think they have already integrated FedCM in the library in this PR: https://github.com/MomenSherif/react-oauth/pull/316

VaibhavTessell commented 7 months ago
<GoogleLogin
    clientId="CLIENT_ID"
    text="Sign in with Google"
    onSuccess={onSuccessHandler}
    onError={onFailureHandler}
    ux_mode="redirect"
    useOneTap
    auto_select

    // New Addition for FedCM integration
--> containerProps={{ allow: "identity-credentials-get" }}
--> use_fedcm_for_prompt

/>

After adding the containerProps and use_fedcm_for_prompt Google login started working with FedCM integration.

@rjtbansal @MuhammadAakash

rjtbansal commented 7 months ago

@VaibhavTessell This is great as I dont see those warnings anymore! Just for the knowledge if possible could you please share how did you identify containerProps to be the fix?

ssteuteville commented 6 months ago

how would i do this for the auth code flow, not seeing how to do that with GoogleLogin and don't see any props available for fedcm with useLogin