Wrong authentication?
Guillem C <[email protected]>
| Newsgroups | gmane.comp.web.blogger.api |
|---|---|
| Message-ID | <[email protected]> |
I'm using python to use the Blogger API and even though I am authenticated
I don't get the correct data of my account.
I use the following code to authenticate and ask for my user infomration:
import json
from httplib2 import Http
from oauth2client.client import SignedJwtAssertionCredentials
from apiclient.discovery import build
client_email = EMAIL_KEY
with open(PRIVATE_KEY_FILE.p12) as f:
private_key = f.read()
credentials = SignedJwtAssertionCredentials(client_email, private_key,
['https://www.googleapis.com/auth/blogger','https://www.googleapis.com/auth/blogger.readonly'])
http = Http()
credentials.authorize(http)
blogger = build('blogger', 'v3', http=http)
response = blogger.users().get(userId='self').execute()
print response
The code works so I can use the API while being authenticated, but when I
request my users's info I get this:
{u'kind': u'blogger#user', u'displayName': u'Unknown', u'url': u
'http://www.blogger.com/profile/11942623289781229535', u'blogs': {u
'selfLink': u
'https://www.googleapis.com/blogger/v3/users/11942623289781229535/blogs'}, u
'id': u'11942623289781229535', u'selfLink': u
'https://www.googleapis.com/blogger/v3/users/11942623289781229535'}
Which is not my info since the id doesn't match my id. Am I doing something
wrong?
--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/bloggerdev.
For more options, visit https://groups.google.com/d/optout.