Google Auth API Javascript idpiframe initialization error on Chrome

前端 未结 4 1882
庸人自扰
庸人自扰 2021-02-18 13:53

I use GSuite and I\'m coding a very simple web app to use Google Auth API, and I get an exception \"idpiframe_initialization_failed\".

Now I have the exact HTML as shown

相关标签:
4条回答
  • 2021-02-18 14:23

    I encountered the same issue. After investing some time, found the reason. This error is because in chrome settings, you have the Block third-party cookies and site data option enabled.

    It can be resolved by disabling this option: "To find the setting, open Chrome settings, type "Content settings" in the search box, click the Content Settings button, and view the fourth item under Cookies." Uncheck the box "Block third-party cookies and site data".

    Hopefully this helps you in resolving your issue.

    0 讨论(0)
  • 2021-02-18 14:32

    The problem is with Google's API console and how it handles creating credentials. It only seems to work when I access it through the following url https://developers.google.com/identity/sign-in/web/sign-in#before_you_begin There is a link that lets you create your app and the OAuth credentials. When I go to the console and create it through that screen it doesn't seem to work. After trying and re-create again and test with a fresh app I found out that the URL you add to the Authorized Javascript Origins doesn't always get added.

    If everything is good then the url should be available in the credentials page

    0 讨论(0)
  • 2021-02-18 14:38

    I had the same problem and I searched for 3 days: Resolve " popup_closed_by_user" Go to your console.google go to your API MANAGE : Credentials:modify your credentials:

    Authorized Javascript origin (http://localhost:port); authorized redirect URI(http://localhost:port/auth/google/callback);

    Example:|| Authorized Javascript origin (http://localhost:4200); authorized redirect URI (http://localhost:4200/auth/google/callback)

    0 讨论(0)
  • 2021-02-18 14:44

    In my case, I just had to wait a bit for Google to take the origin into account. I cannot tell exactly how long it took. I waited ~30min. I then went to sleep and it was working the following morning.

    Edit: Ooops I just realized I was using http:// and not https://. That was the actual problem.

    0 讨论(0)
提交回复
热议问题