carolinux / gdata-python-client

Automatically exported from code.google.com/p/gdata-python-client
0 stars 1 forks source link

No Scopes on HTTP Header when request for oauth token using GDClient #457

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Following tutorial here 
http://code.google.com/apis/gdata/docs/auth/oauth.html 
2.Try to fetch request token using latest library

Fail to get request token with error : 
Exception Type: TypeError
Exception Value:    
request() takes at least 3 arguments (2 given)
Exception Location: C:\Users\hudarsono\Sites\appengine\shinemob\gdata\client.py 
in get_oauth_token, line 572

Deeper inspection found that :
function generate_request_for_request_token on file gauth.py produce http 
header like this :
'Content-Length': '0', 
'Authorization': 'OAuth oauth_nonce="254035812220640", 
oauth_timestamp="1286967300", oaut
h_consumer_key="example.com", oauth_signature_method="HMAC-SHA1", oauth_version=
"1.0", oauth_signature="HmRLGavgWYcv4C6bGzD2pawLnYc%3D", 
oauth_callback="http%3A%2F%2Flocalhost%3A8080%2Fget_oauth_token%2F"'

Which is only 2 argument. No scopes argument. There is this line of code inside 
that function 

if scopes:
    request.uri.query['scope'] = ' '.join(scopes)

If try to print out the scopes before if statement, the scopes are there, and 
request.uri get executed. But if we print out request, there is still no scope 
there?

What version of the product are you using?
2.0.12

Please provide any additional information below.

I use windows , python v 5.2.4. 

Original issue reported on code.google.com by hudars...@gmail.com on 13 Oct 2010 at 11:14

GoogleCodeExporter commented 9 years ago
Sorry, this part seems to work fine, we remove the param 
(google_apps_domain=domain) from the code in the tutorial below :

domain = None  
self.redirect(request_token.generate_authorization_url(google_apps_domain=domain
))

Original comment by hudars...@gmail.com on 15 Oct 2010 at 6:35

GoogleCodeExporter commented 9 years ago

Original comment by joe.gregorio@gmail.com on 21 Jan 2011 at 8:02