Hi Timur
I think this may not be the best practice to adopt. Reason being you are
using two different things. The Playground is to give you a feel of the
oauth flow where as gdata libraries are for the users to use the API easily.
Now mistakes in the code snippet are:
when you call SetAuthToken it puts another token on the token_store which
obviously doesn't have the Input parameters set. So this is the first
mistake.
Second now if you again do a SetOauthInputParams it will put another request
token whose value will not be equal to the access token.
There is a possible work around this problems:
client = gdata.apps.service.AppsService(source='app', domain='domain.com')
client.SetOAuthInputParameters(SIG_METHOD, CONSUMER_KEY,
consumer_secret=CONSUMER_SECRET)
temp_token = gdata.auth.OAuthToken(key=TOKEN, secret=TOKEN_SECRET) #make a
new temp token
temp_token.oauth_input_params = client.GetOAuthInputParameters() #make its
input
#parameters equal to the
#values u
just set
client.SetOAuthToken(temp_token) #now set Oauth token equal to
this temp token
print client.RetrieveUser("username")
So here the new temp token will take the top of your toke_store and the
things will start working.
But still the best way is to do it entirely using gdata-libraries refer the
following
example<http://code.google.com/p/gdata-python-client/source/browse/samples/oauth/oauth_example.py>
.
--
You received this message because you are subscribed to the Google Groups
"Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-apps-mgmt-apis/-/6M1Jlt-s8OYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-apps-mgmt-apis?hl=en.