4

I'm following Google's great sample code for three-legged OAuth.

Specifically, I'm looking at the python version of the code. I'm stuck between 'Upgrading to an access token' and 'Using an access token'.

In 'Upgrading to an access token', there is a line of code as follows:

access_token = client.GetAccessToken(request_token)

In 'Using an access token', there is a line of code as follows:

client.auth_token = gdata.gauth.OAuthHmacToken(CONSUMER_KEY,
                                               CONSUMER_SECRET,
                                               TOKEN,
                                               TOKEN_SECRET, 
                                               gdata.gauth.ACCESS_TOKEN)

I assume TOKEN and TOKEN_SECRET are packed into the access_token object (gdata.gauth.OAuthHmacToken), but how do I retrieve them?

Thanks!

Courtney Christensen
  • 9,165
  • 5
  • 47
  • 56
sonofabell
  • 91
  • 1
  • 6

1 Answers1

1

I was able to figure this out.

access_token is of type gdata.gauth.OAuthHmacToken. So instead of trying to pass in the individual arguments, I could just do this:

client.auth_token = access_token
Cosmin
  • 21,216
  • 5
  • 45
  • 60
sonofabell
  • 91
  • 1
  • 6