错误:授权Google Analytics嵌入API时origin_mismatch
Error: origin_mismatch when authorizing embed API for Google Analytics
我正试图在第三方CMS中实现谷歌分析的统计仪表板,但遇到了一些问题。我正在尝试使用谷歌嵌入API来构建我的仪表板,当我尝试验证我的帐户时遇到了这个错误:
Error: origin_mismatch
我四处寻找解决方案,很快发现是因为缺少www.
。问题是,我在谷歌开发者控制台中填写了正确的URL,但仍然没有运气。有人知道我该怎么解决这个问题吗?
Error: origin_mismatch
Application: CMEZ Analytics
You can email the developer of this application at: email@email.com
Request Details
=
from_login=1
response_type=code token id_token gsession
scope=https://www.googleapis.com/auth/analytics.readonly https://www.googleapis.com/auth/userinfo.email
redirect_uri=postmessage
cookie_policy=single_host_origin
proxy=oauth2relay482041337
include_granted_scopes=true
origin=http://cmez.eu
state=458516662|0.59538506
as=1d7def2550073266
client_id=[censored]
authuser=1
hl=nl
That’s all we know.
origin_mismatch
错误可能是由于Javascript源代码没有在项目的Google Developer控制台中正确设置所致。Javascript的来源必须与您的请求来自的域以及您在登录后将用户返回的域相匹配。
注意:这里的一个常见错误是为http://而不是https://添加javascript源代码(反之亦然)。如果url中出现端口号,则还必须将服务器的端口号包含在javascript源中。
文档信息
在Authorized JavaScript originals字段中,输入您的应用程序。您可以输入多个来源以允许应用程序在其上运行不同的协议、域或子域。通配符不是允许。在下面的示例中,第二个URL可能是生产URL。http://localhost:4567
https://myproductionurl.example.com
相关文章:
- 如何解决Access Control Allow Origin错误
- 由于响应中不存在“Access Control Allow Origin”标头,跨域请求停止工作
- Ajax调用ERror Cross Origin REquest:在rails中自动完成大学列表
- Angularjs http.get() Cross-Origin 请求被阻止
- Cross Origin Chrome Extension
- Angular Cross Origin Request CORS失败,但节点http.get()成功返回
- XMLHttpRequest : 不被 access-control-allow-origin 所允许
- XMLHttpRequest无法加载url Origin访问控制允许Origin不允许null
- 可以在Access Control Allow Origin中指定端口
- Access Control Allow Origin阻止我访问google api,尽管使用了dataType:
- JSONP跨原点错误'不存在Access Control Allow Origin标头'
- 角度:原点http://localhost在Access Control Allow Origin标头中找不到
- 通过php访问控制允许Origin服务器端
- Jquery以使用WCF.错误:XMLHttpRequest无法加载Origin.访问控制允许Origin不允许null
- 在nodejs和origin ajax中使用jsonp
- 在 Safari 上使用通用分析的 Access-Control-Allow-Origin 不允许
- Windows上的CouchDB说请求的资源上不存在“Access-Control-Allow-Origin”标头
- XMLHttpRequest 无法加载 http No Access-Control-Allow-Origin head
- Simple XMLHttpRequest 失败,Access-Control-Allow-Origin 标头为 nul
- jquery.ajax Access-Control-Allow-Origin