googleworkspace / browser-samples

Web samples for Google Workspace APIs
Apache License 2.0
324 stars 560 forks source link

idpiframe_initialization_failed: Cookies are not enabled in current environment. #68

Open erdseb opened 3 years ago

erdseb commented 3 years ago

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


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

erdseb commented 3 years ago

Any thoughts?

raxod502 commented 3 years ago

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.

MaisumAbbas commented 3 years ago

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

gabycperezdias commented 2 years ago

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?

shadow-identity commented 2 years ago

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

gabycperezdias commented 2 years ago

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

shadow-identity commented 2 years ago

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

gabycperezdias commented 2 years ago

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