gapi.auth2.ExternallyVisibleError: Invalid cookiePolicy

妖精的绣舞 提交于 2019-12-17 18:45:36

问题


I'm trying to add a Google Sign In Authentication system to my app, but I keep getting a strange error that I haven't seen anyone get. I'm using EXACTLY the google example code.

I thought it could be some mistake when loading the api, so I checked the async loading and everything seems to be loading properly, but I keep getting this error in the console:

gapi.auth2.ExternallyVisibleError: Invalid cookiePolicy

I searched everywhere for people with the same problem, but I could not find anything similar.

Any ideas?

EDIT: I tried to create a page with ONLY the code of the tutorial, but the error still occurs.


回答1:


Well, turns out I was trying to test the API by directly acessing my files locally (index.html). The Google Sign In API only works in a running web server. I started a simple node.js server, ran my app trhough this server, and everthing worked just fine.




回答2:


As already answered by KoJoVe, you need to run inside a web server. If you are using Python 2.7 you might use python -m SimpleHTTPServer 8000 and then use localhost:8000 on your browser



来源:https://stackoverflow.com/questions/32896597/gapi-auth2-externallyvisibleerror-invalid-cookiepolicy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!