browser-samples icon indicating copy to clipboard operation
browser-samples copied to clipboard

idpiframe_initialization_failed: Cookies are not enabled in current environment.

Open erdseb opened this issue 4 years ago • 8 comments

I'm running sample https://github.com/gsuitedevs/browser-samples/blob/master/drive/quickstart/index.html with Client and API ID filled in.

Expected Behavior

  • a) An entry in "troobleshooting" that helps me understand what to do and if the fault is mine or not
  • b) That the example works out of the box and displays something like this:

chromium_success


Actual Behavior

I see nothing but this text in the browser:

Drive API Quickstart

{
  "error": "idpiframe_initialization_failed",
  "details": "Cookies are not enabled in current environment."
}

I have checked the troubleshooting hints at https://github.com/gsuitedevs/browser-samples/blob/master/README.md#troubleshooting but case Cookies are not enabled in current environment. is not listed. Also, I have not disabled anything about cookies manually, so a need to start Googling what to do. It turns out I need to disable Block third-party cookies here…


chromium_cookies


…that seems to be enabled by default, which seems right to me. I'd frankly rather not disable it — why does Google Drive force me to do that?

JavaScript Console Output

There was no output on the console

Specifications

  • Browser (Chrome/Internet Explorer/Firefox): Chromium 83.0.4103.116 from Debian
  • OS (Mac/Linux/Windows): Debian bullseye

erdseb avatar Aug 20 '20 13:08 erdseb

Any thoughts?

erdseb avatar Aug 25 '20 10:08 erdseb

Unfortunately, Google appears to have no desire to fix the issue. See the disappointing discussion in https://github.com/google/google-api-javascript-client/issues/260. The recommended solution is to stop using the Google API JavaScript client, and implement a server-side flow instead.

raxod502 avatar Dec 24 '20 16:12 raxod502

This may help: https://stackoverflow.com/questions/63631849/google-sign-in-not-working-in-incognito-mode

MaisumAbbas avatar Feb 04 '21 05:02 MaisumAbbas

Hi :)

I understand google is not exactly interested in fixing this, but they released a new Google Identity Service for signin.... any idea if this new process fixes this issue, and if so, how to integrate both?

gabycperezdias avatar Nov 15 '21 23:11 gabycperezdias

@gabycperezdias I just logged with Google Identity to my local server in using this documentation: https://developers.google.com/identity/gsi/web/guides/overview

shadow-identity avatar Jan 14 '22 20:01 shadow-identity

@shadow-identity I was able to login as well on normal tabs + third-party cookies enabled, but how to get an auth token to make the gpicker to work for example? I got the JWT, I worked with that, but there are no auth token to be passed to the picker... not only that, but turning off third-party cookies still breaks the new login for me...

gabycperezdias avatar Jan 15 '22 04:01 gabycperezdias

@gabycperezdias I'm sorry I misled you. Seems like new Google Identity API currently works only for authentication purposes. I also didn't find any way to pass auth from google.auth go gapi instance. Seems like we just have to wait for Google to adapt its API to the new authorization procedure. Funny that the old one (with gapi.client etc) is already marked as deprecated, although there are no alternatives to using it for gapi.

shadow-identity avatar Jan 27 '22 16:01 shadow-identity

@shadow-identity I created this issue with google https://issuetracker.google.com/issues/209651857 but I think they are ignoring me after the last interaction...

gabycperezdias avatar Jan 27 '22 17:01 gabycperezdias