Google API: Not a valid origin for the client: url has not been whitelisted for client ID “ID”

前端 未结 17 1506
北海茫月
北海茫月 2020-12-23 14:34

I need help. I don\'t found an answer to my question. I tried googling and I tried asking on other sides but I never found an answer.

I\'m working with the google API

相关标签:
17条回答
  • 2020-12-23 14:37

    I faced the same issue while working with google sign-in using react-social-login on my localhost. In the whitelist origin we will have to provide http://localhost:3000 to make it work.

    0 讨论(0)
  • 2020-12-23 14:40

    The documentation says not to overlook two critical steps ("As you go through the instructions, it's important that you not overlook these two critical steps: Enable the Analytics API Here's what worked for me:

    1. Enable the Analytics API
    2. back to you credentials , delete previous OAuth 2.0
    3. now create new OAuth with correct origins
    0 讨论(0)
  • I cleared cache. Started working then.

    In Chrome: Settings --> Advanced --> Clear browsing data --> Cached images and files

    0 讨论(0)
  • 2020-12-23 14:42

    I was also attempting to get the sample working (from ) https://developers.google.com/drive/api/v3/quickstart/js

    It continually failed even though the ip address was added to the WebAPI.

    But you have to add localhost:8000 (not just 127.0.0.1:8000) to your OAUTH as shown here:

    Float over the OAUTH client text and it will become a link. Click that link and you can add a URI including the port. Mine already had 127.0.0.1:8000 but not the locahost:8000.

    Here's the interesting / odd thing. When I ping localhost I see:

    I think that is IPV6 thing.

    Anyways, if I ping 127.0.0.1 I see the expected response (via IPV4)

    Maybe that is a red herring but I wasn't sure if the value entered in the OAUTH was affected by it or not.

    The reason I even noticed that is because when I started the Python web server as directed in the tutorial I saw the following and thought it was odd:

    Only after adding the localhost:8000 URI in the OAUTH did it work, but after adding it did work fine.

    0 讨论(0)
  • 2020-12-23 14:49

    Had the same problem and here's how I solved it:

    1. Activate both Analytics and Google Plus APIs on your project
    2. Create new OAUTH 2.0 client credentials
      • Add the Authorized Javascript Origins under Restrictions section
    3. Use the new client id.

    Enjoy.

    0 讨论(0)
  • 2020-12-23 14:49

    I was having a similar issue trying to get a login for my web app. What I did was just recreate the OAuth Client ID credentials from Cloud Platform. When I did this and used the new Client ID, everything worked fine. Not sure what the issue was before, but it goes through perfectly fine now.

    If anyone finds this from Google or whatnot, try that. It might just work. It would explain Ezra Obiwale's answer because that is essentially creating a new Client ID just after adding a couple API's.

    If anyone knows an explanation as to why this happens that would be appreciated.

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