【发布时间】:2014-07-25 16:59:44
【问题描述】:
我尝试调用 Ajax GET 方法来访问资产 - 我创建的谷歌地图引擎资产,给定资产 ID。
$.ajax({
cache: false,
url: 'https://www.googleapis.com/mapsengine/v1/assets/0773289246413284785416071188762309719429',
type: 'GET',
async: false,
success: function(result){
console.log(result);
}
});
但这不起作用,并且出现错误:
GET https://www.googleapis.com/mapsengine/v1/assets/07732892464132847854-16071188762309719429?_=1406257065386 401 (Unauthorized)
说它是未经授权的。当我执行时,我尝试使用资产 ID 在 google Asset 中测试 GET 资产。它说:
This method requires you to be authenticated. You may need to activate the toggle above to authorize your request using OAuth 2.0.
我可以在那里测试 GET 资产,方法是在那里提供 OAuth。但是我如何在我的应用程序中做到这一点?如何提供 OAuth 2.0 身份验证以便我可以访问资产?谢谢!
【问题讨论】:
标签: google-maps google-app-engine oauth oauth-2.0 google-oauth