-
Notifications
You must be signed in to change notification settings - Fork 280
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
<pwa-auth>
– enable Sign in with Google with a reduced response when strict privacy mode (Block third-party cookies or InPrivate browsing) is used (until we switch to Google Identity Services for Web).
#3343
Conversation
…th a reduced response when strict privacy mode (Block third-party cookies or InPrivate Browsing) is used (until we switch to Google Identity Services for Web as tracked in pwa-builder#3309).
…th a reduced response when strict privacy mode (Block third-party cookies or InPrivate Browsing) is used (until we switch to Google Identity Services for Web as tracked in pwa-builder#3309).
Thanks cetinsert for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
…th a reduced response when strict privacy mode (Block third-party cookies or InPrivate Browsing) is used (until we switch to Google Identity Services for Web as tracked in pwa-builder#3309).
…th a reduced response when strict privacy mode (Block third-party cookies or InPrivate Browsing) is used (until we switch to Google Identity Services for Web as tracked in pwa-builder#3309).
You can also quickly test this with the following steps:
Exact match of this commit hosted for your convenience: https://ic.rt.ht/google-provider-e3c8088c.js - <script type="module" src="https://cdn.jsdelivr.net/npm/@pwabuilder/pwaauth@latest/dist/pwa-auth.min.js"></script>
+ <script type="module" src="//ic.rt.ht/pwa-auth.min.js"></script> <!-- matches the pull request verbatim --> A version with additional
|
…th a reduced response when strict privacy mode (Block third-party cookies or InPrivate Browsing) is used (until we switch to Google Identity Services for Web as tracked in pwa-builder#3309).
…th a reduced response when strict privacy mode (Block third-party cookies or InPrivate Browsing) is used (until we switch to Google Identity Services for Web as tracked in pwa-builder#3309).
<pwa-auth>
– temporarily address #3286 to enable Sign in with Google with a reduced response when strict privacy mode (Block third-party cookies or InPrivate Browsing) is used (until we switch to Google Identity Services for Web as tracked in #3309).
<pwa-auth>
– temporarily address #3286 to enable Sign in with Google with a reduced response when strict privacy mode (Block third-party cookies or InPrivate Browsing) is used (until we switch to Google Identity Services for Web as tracked in #3309).<pwa-auth>
– temporarily enable Sign in with Google with a reduced response when strict privacy mode (Block third-party cookies or InPrivate Browsing) is used (until we switch to Google Identity Services for Web).
<pwa-auth>
– temporarily enable Sign in with Google with a reduced response when strict privacy mode (Block third-party cookies or InPrivate Browsing) is used (until we switch to Google Identity Services for Web).<pwa-auth>
– temporarenable Sign in with Google with a reduced response when strict privacy mode (Block third-party cookies or InPrivate Browsing) is used (until we switch to Google Identity Services for Web).
<pwa-auth>
– temporarenable Sign in with Google with a reduced response when strict privacy mode (Block third-party cookies or InPrivate Browsing) is used (until we switch to Google Identity Services for Web).<pwa-auth>
– enable Sign in with Google with a reduced response when strict privacy mode (Block third-party cookies or InPrivate Browsing) is used (until we switch to Google Identity Services for Web).
<pwa-auth>
– enable Sign in with Google with a reduced response when strict privacy mode (Block third-party cookies or InPrivate Browsing) is used (until we switch to Google Identity Services for Web).<pwa-auth>
– enable Sign in with Google with a reduced response when strict privacy mode (Block third-party cookies or InPrivate browsing) is used (until we switch to Google Identity Services for Web).
With the last 2 commits, we have tested all cases and exhausted developer resources we will dedicate to this workaround. (The convenience links mentioned in #3343 (comment) are kept up-to-date and still available for your testing with the above 2 commits included.) Tested interactions
+ tested multiple times Click/tap here to see the
|
// (Use only a reduced response when people Block third-party cookies or use InPrivate browsing.) | ||
const I = auth.signIn(); | ||
const Y = async signal => { | ||
const z = await event('message', { signal, map: e => JP(e.data), find: d => d?.params?.type == 'authResult' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.data
{
"method": "fireIdpEvent",
"params": {
"type": "authResult",
"clientId": "57804582347-fjts48vf74aujonq0akjmh16ta0kuuak.apps.googleusercontent.com",
"id": "auth395061",
"authResult": {
"scope": "email profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile openid",
"id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjE3MjdiNmI0OTQwMmI5Y2Y5NWJlNGU4ZmQzOGFhN2U3YzExNjQ0YjEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJhY2NvdW50cy5nb29nbGUuY29tIiwiYXpwIjoiNTc4MDQ1ODIzNDctZmp0czQ4dmY3NGF1am9ucTBha2ptaDE2dGEwa3V1YWsuYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhdWQiOiI1NzgwNDU4MjM0Ny1manRzNDh2Zjc0YXVqb25xMGFram1oMTZ0YTBrdXVhay5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbSIsInN1YiI6IjEwMjYyODQ1NTQ5MDkwMTk0NTI2MiIsImVtYWlsIjoiY2V0aW4uc2VydEBnbWFpbC5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaWF0IjoxNjYwODc2MTcxLCJleHAiOjE2NjA4Nzk3NzEsImp0aSI6IjAyOTRlYzhiMTViOGMxNDYyNGM3NDZhMGYzZjNkOTZmODczMTA5ZmUifQ.da6OcBgxGctw4eKXVn6vquTwj3mSRnkUwQFFCPpJVRDC6qeGop07vfSwhz2FceR9_QbWt9nFGdbeELY8X47EDARUbCzfNRH80IUQ2BnZ62X3Y-Zrzb8KK1QXR8sBZuA2HubtF6hJ-Rz4FIBAH8nTVdoK68JPIX_kY_3CH_WfcYeZwgLaUj2z9vLo6ScI2l_opGdc12JiyaqSLWAy_HHfY4ooyogIoeiCn8fxTuOYLx3PFoOXyYilf39zhELR70G28kl_Q3rzXyMB4_1xTRGLNn5p76l8HPEhB-xs0-agNsEpjn79GaCDIOQfI5_qNXtUVd88OL7wyJ4s3JolUh7v2w",
"login_hint": "AJDLj6JTnD9r5nUgBTjHPh9yEse-ZVOAAuXsa0TMIG26duGuqQvjeAHqDZsUu1-mHw6Et__QhInJSlsBKxsE7MtamnbsupuUog",
"client_id": "57804582347-fjts48vf74aujonq0akjmh16ta0kuuak.apps.googleusercontent.com"
}
}
},
try { return this.getSignInResultFromUser(await I); } | ||
catch (q) { return x ; } | ||
}; | ||
const N = async signal => { event('message', { signal, map: e => JP(e.data), find: d => d?.params?.type == 'idpError' }).then(_ => wait.twice = true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.data
{
"method": "fireIdpEvent",
"params": {
"type": "idpError",
"error": "Cookies are not enabled in current environment."
},
"rpcToken": "1227886743.6877475"
},
Hey @CetinSert, you say this is a temporary fix. Does that mean that when we move to Google Identity Services for Web this will no longer be needed? In that case, could we prioritize that over this? |
@amrutha95 That was my understanding, so I assume: yes, and yes. |
I say this is temporary because,
@amrutha95, @nmetulev – I have just confirmed this for you:
Yes! Please also note the following!!https://developers.google.com/identity/sign-in/web/reference
Google Platform Library already doesn't accept new clients! So, Please prioritize |
@CetinSert is it possible for you to help us with migrating to the new library? And thanks for finding out all this info. We will definitely make sure to get this done before deprecation. |
@amrutha95 – unfortunately, I do not have time to perform the migration for you. I will be looking forward to your work on it though! |
@CetinSert got it. If that changes before we prioritize it please let us know. We are working on adding authentication for PWABuilder using pwa-auth, so we will have to get to this sooner rather than later. You also mentioned you have found your workaround for it for now. I think we can keep this as a known issue rather than fixing something that is going to change anyway. What do you think? |
Yes, please do so. Thank you. I am closing this pull request now. |
This is a
<pwa-auth>
– Sign in with Google fails when Block third-party cookies or InPrivate browsing is turned on #3286requested by @maraah1 in
<pwa-auth>
– Sign in with Google fails when Block third-party cookies or InPrivate browsing is turned on #3286 (comment)<pwa-auth>
switches to the new Google Identity Services for Webtracked in
<pwa-auth>
– Google is replacing its "Sign-in JavaScript Platform Library" with the new "Identity Services for Web" in March 2023 #3309PR Type
Bugfix
Describe the current behavior?
See #3286.
Sign in with Google does not work when people Block third-party cookies or use InPrivate browsing.
Describe the new behavior?
See #3286 (comment)
Sign in with Google works with a reduced response (only the email adress, no name or image) when people Block third-party cookies or use InPrivate browsing.
PR Checklist
npm run test
and ensure that all tests passTest on our next-gen web playground
See this in production on our next-gen web playground: //rt.ht ⬅️
We recommend using the Windows Sandbox for a clean state.
Test on
pwa-auth-list.glitch.me
See #3343 (comment) ⬇️