Ajax 获取谷歌&x27;s openid配置发现文档导致cors错误

Ajax 获取谷歌&x27;s openid配置发现文档导致cors错误,ajax,angularjs,openid,google-authentication,google-openid,Ajax,Angularjs,Openid,Google Authentication,Google Openid,我试图通过$http服务访问google discovery文档,但收到cors错误 以下是错误: MLHttpRequest cannot load https://accounts.google.com/.well-known/openid-configuration. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:1485' is

我试图通过$http服务访问google discovery文档,但收到cors错误

以下是错误:

MLHttpRequest cannot load https://accounts.google.com/.well-known/openid-configuration. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:1485' is therefore not allowed access.
我知道这与CORS有关,我想在加载文档后从该文档中获取angular服务中的授权端点。如果我不加载文档并直接硬编码authorization_endpoint(),一切都正常,但我想创建一个可以从发现端点配置的服务

我的问题是:

是否有人成功地从ajax请求加载了google openId发现文档?(来自$http服务?)


关于

您是否尝试使用jsonp而不是jsonI尝试了以下操作:$http({url:'',方法:“jsonp”,标题:{'Content Type':'application/javascript'),但收到此错误:(拒绝从“”执行脚本,因为它的MIME类型('application/json')不可执行,并且启用了严格的MIME类型检查)@CedricDumont您能找到解决方案吗?我这里也有同样的问题。