Hi,
I couldnt get my way out of this problem.
gdocs = gdata.service.GDataService(source=SETTINGS['APP_NAME'])
gdocs.SetOAuthInputParameters(SETTINGS['SIG_METHOD'],
SETTINGS['CONSUMER_KEY'],
consumer_secret
= SETTINGS['CONSUMER_SECRET'])
gdata.alt.appengine.run_on_appengine(gdocs)
def get_oauth_token(request):
sess = Session()
oauth_token =
gdata.auth.OAuthTokenFromUrl(request.build_absolute_uri())
if oauth_token:
oauth_token.secret = sess['oauth_token_secret']
oauth_token.oauth_input_params = gdocs.GetOAuthInputParameters()
gdocs.SetOAuthToken(oauth_token)
oauth_verifier = request.GET.get('oauth_verifier', '')
access_token =
gdocs.UpgradeToOAuthAccessToken(oauth_verifier=oauth_verifier)
if access_token and users.get_current_user():
gdocs.token_store.add_token(access_token)
elif access_token:
gdocs.current_token = access_token
gdocs.SetOAuthToken(access_token)
return HttpResponseRedirect('/listdocs')
else:
if users.get_current_user():
req_token = gdocs.FetchOAuthRequestToken(
scopes=SETTINGS['SCOPES'],oauth_callback=request.build_absolute_uri()
)
sess['oauth_token_secret'] = req_token.secret
approval_page_url =
gdocs.GenerateOAuthAuthorizationURL()
return HttpResponseRedirect(approval_page_url);
It always fail when try to get Authorization URL. And got this error :
Exception Type: NonOAuthToken
Exception Value:
Exception Location: C:\Users\hudarsono\Sites\appengine\shinemob\gdata
\service.py in GenerateOAuthAuthorizationURL, line 4
But it works if we i change the client from
gdocs = gdata.service.GDataService(source=SETTINGS['APP_NAME'])
to
gdocs = gdata.docs.service.DocsService(source=SETTINGS['APP_NAME'])
May I know what is the difference? Since i know that DocsService
extend GDataService. I use GDataService because want to make it more
general, since I use several scopes, not only docs.
Thanks
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
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-appengine?hl=en.