Google API:不是客户端的有效来源:url尚未被列入白名单,客户端ID为“ID” [英] Google API: Not a valid origin for the client: url has not been whitelisted for client ID "ID"

查看:648
本文介绍了Google API:不是客户端的有效来源:url尚未被列入白名单,客户端ID为“ID”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助。我没有找到我的问题的答案。我尝试了谷歌搜索,我试图在其他方面问,但我从来没有找到答案。

我正在使用google API(Youtube数据API),并使用来自Google端的示例代码,它的工作原理我很肯定。当我尝试启动脚本时遇到错误:


详细信息:不是客户端的有效来源:MyURL没有已将客户IDMyID列入白名单。请转至 https://console.developers.google.com/,然后将您的项目客户端ID的白名单列入白名单。



错误:idpiframe_initialization_failed

我将我的网站列入白名单的问题已被接受。我不知道什么是错的。我应该怎么做白名单我的域名(它被列入白名单)



还有另外一个问题。我以前没有在这个问题上寻找答案。



我认为我可以在Localhost上使用代码,我认为我必须将我的localhost地址列入白名单喜欢这个。但白名单无效。


$ b

  • DreamGamer



  1. 同时激活Google Analytics和Google在您的项目中添加API

  2. 创建新的OAUTH 2.0客户端凭据


    • 添加 Authorized Javascript Origins 限制部分


  3. 使用新的客户端ID。 / ol>

    享受。

    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 (Youtube data API) and I use the example code from the google side the code it works I'm pretty sure about that. I got an error when i try to start the Script:

    details: "Not a valid origin for the client: "MyURL" has not been whitelisted for client ID "MyID". Please go to https://console.developers.google.com/ and whitelist this origin for your project's client ID."

    error: "idpiframe_initialization_failed"

    The problem i whitelisted my Website and it's accepted. i don't know what is wrong. What should i do to "whitelist" my Domain (It's whitelisted)

    And another question. I did not search for an answer on this question before.

    I think it's possible that I can use the code on Localhost, I think I must whitelist my localhost address or something like this. But whitelisting does not work.

    • DreamGamer

    解决方案

    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.

    这篇关于Google API:不是客户端的有效来源:url尚未被列入白名单,客户端ID为“ID”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆