It's been mentioned here that OAuth Playground can be used to generate an OAuth token and store it for future use with applications that run as scheduled tasks. I am straggling to make this process to work.
Here are the steps I am taking on OAuth Playground:
2. Signature method:
HMAC-SHA1. Enter consumer key and secret from the cpanel.
3. Click Request token.
4. Click
Authorize. Click Grant access
5. Click Access token
At this point I have the token and the token secret.
I am attempting to use them in the following Python code with gdata library:
CONSUMER_SECRET = 'secret'
SIG_METHOD = gdata.auth.OAuthSignatureMethod.HMAC_SHA1
TOKEN = "token"
TOKEN_SECRET = "token secret"
client = gdata.apps.service.AppsService(source='app', domain='domain.com') client.SetOAuthInputParameters(SIG_METHOD, CONSUMER_KEY, consumer_secret=CONSUMER_SECRET)
client.SetOAuthToken(gdata.auth.OAuthToken(key=TOKEN, secret=TOKEN_SECRET))
client.RetrieveUser("domainuser")
the last line of the code throws the following error:
'NoneType' object has no attribute 'requestor_id'
Am I missing any of the steps? Is the code I am using incorrect?
Thank you.