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

Google Sign-in doesn't do anything when I block 3rd party cookies #190

Closed
ghost opened this issue Mar 21, 2016 · 6 comments
Closed

Google Sign-in doesn't do anything when I block 3rd party cookies #190

ghost opened this issue Mar 21, 2016 · 6 comments

Comments

@ghost
Copy link

ghost commented Mar 21, 2016

Hi,

I saw that code here is only for Android and IOS but I thought that maybe somebody here can answer my question.

I am building AngularJS application that uses basic Google Signin process https://developers.google.com/identity/sign-in/web/.

Everything works fine, I can sign in as a google user except I have one issue when I disable third party cookies.

When third party cookies are disabled on browser like this (Chrome) content settings google sign in process does nothing.

More precisely I have a function that triggers on onsuccess event for google button but does nothing. Also I am not possible to catch an error so I can't workaround after this.

One thing that is happening also is that on loading google meta data when third-party cookies are disabled it raises an error

Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document

It seems that google does everything fine like it should be on success but doesn't execute the code that is in that onsuccess function.

I tried everything and even on google developers site on Integrate Sign-in page when I click on sample sign in button it happens the same:

  • If I enable cookies it returns to me "signed in as: MyName"
  • If I disable cookies it returns nothing to me

The overall question is, is there a way to catch this error and work around this and not having google executes everything like it is ok and doesn't execute code that is in onsuccess function?

@ianbarber
Copy link
Contributor

What are you setting your cookie policy too? It should be possible to use google sign in without 3p cookies enabled as far as I understand it.

@ghost
Copy link
Author

ghost commented Mar 29, 2016

My cookie policy is set to Allow local data to be set and Block third party cookies and site data is checked.

The problem is that with this settings google doesn't raise disabled cookie error. The behavior is like everything is ok but callback function is never called. This can be verified here: https://developers.google.com/identity/sign-in/web/sign-in?hl=sr#specify_your_apps_client_id when you click on demo google button (when third party cookies and site data are allowed) you can see "Signed in as: YOUR NAME" logged in console and with my settings when you click on the same button nothing is happening (no error just nothing is happening, like callback function is not called).

@ianbarber
Copy link
Contributor

Sorry, I meant the cookie_policy parameter in your sign in integration. Maybe try setting it to "none" if it is currently single_host_origin?

@ghost
Copy link
Author

ghost commented Mar 31, 2016

I tried with both single_host_origin and none but the result is the same.

@ianbarber
Copy link
Contributor

Closing: thanks for referencing the other thread, looks like a definitive note that 3p cookies are required.

@troublesprouter
Copy link

troublesprouter commented Apr 23, 2019

Closing: thanks for referencing the other thread, looks like a definitive note that 3p cookies are required.

Is it possible to "Sign in with Google" at all by any means with 3rd party cookies disabled? How?

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