Reputation: 626
I would like to leverage Google Photos. My understanding is that it uses the same API as Picasa. I'm using OAuth and make requests with JQuery. Unfortunately all of my requests return:
Token invalid - AuthSub token has wrong scope
The Picasa documentation states to use the following scope:
http://picasaweb.google.com/data/
I'm using it with the OAuth Javascript library as below:
gapi.signin2.render('my-signin2', {
'scope': 'http://picasaweb.google.com/data/',
'width': 200,
'height': 50,
'longtitle': true,
'theme': 'light',
'onsuccess': this.onSignIn
});
I'm able to authenticate and correctly receive an access_token. The scopes listed in the returned authentication object are:
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
Requests to the Picasa service are of this form:
https://picasaweb.google.com/data/feed/api/user/default?access_token=some-real-token
Any idea what I'm doing wrong?
Upvotes: 2
Views: 459
Reputation: 626
Looks like the scope set in the option argument provided to signin2.render is not used. Instead I had to put this in my index.html:
<meta name="google-signin-scope" content="https://picasaweb.google.com/data/">
Upvotes: 1