我想利用谷歌照片。我的理解是它使用与 Picasa 相同的 API。我正在使用 OAuth 并使用 JQuery 发出请求。不幸的是,我所有的请求都返回:
Token invalid - AuthSub token has wrong scope
Picasa 文档声明使用以下范围:
http://picasaweb.google.com/data/
我将它与 OAuth Javascript 库一起使用,如下所示:
gapi.signin2.render('my-signin2', {
'scope': 'http://picasaweb.google.com/data/',
'width': 200,
'height': 50,
'longtitle': true,
'theme': 'light',
'onsuccess': this.onSignIn
});
我能够进行身份验证并正确接收 access_token。返回的身份验证对象中列出的范围是:
https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/picasa openid email profile
对 Picasa 服务的请求采用以下形式:
https://picasaweb.google.com/data/feed/api/user/default?access_token=some-real-token
知道我做错了什么吗?