Gmail API不是有效的来源

时间:2017-11-23 17:27:58

标签: api gmail

我使用的是Gmail API Javascript,但这是个问题。

Uncaught {error: "idpiframe_initialization_failed", details: "Not a valid origin for the client: http://localhos…itelist this origin for your project's client ID."} details : "Not a valid origin for the client: http://localhost has not been whitelisted for client ID 731803464357-pdq2kfb0qg5ahca5gvvht343u2qmbgdk.apps.googleusercontent.com . Please go to https://console.developers.google.com/ and whitelist this origin for your project's client ID." error: "idpiframe_initialization_failed"

这是我的配置文件:http://localhost/b.html

enter image description here

1 个答案:

答案 0 :(得分:0)

在执行HTTP请求之前是否添加了Origin HTTP标头?

const headers = new HttpHeaders().set('Origin', 'http://localhost')