Estoy tratando de implementar "twitter oauth" en appengine (python) usando http://code.google.com/p/oauth-python-twitter.401 No autorizado utilizando oauth-python-twitter
uso el siguiente código para redirigir al usuario en Twitter:
twitter = OAuthApi(CONSUMER_KEY, CONSUMER_SECRET)
request_token = twitter.getRequestToken()
response.set_cookie('request_token', request_token.to_string())
signin_url = twitter.getAuthorizationURL(request_token)
return redirect_to(signin_url)
el usuario es redirigido con éxito pero cuando regresa en mi solicitud de que recibo el siguiente error: HTTP Error 401: no autorizado
File "/base/data/home/apps/app/controllers/users.py", line 46, in authenticate
access_token = twitter.getAccessToken()
File "/base/data/home/apps/app/lib/python/oauthtwitter.py", line 183, in getAccessToken
token = self._FetchUrl(url, no_cache=True)
......
File "/base/python_dist/lib/python2.5/urllib2.py", line 506, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
el error ocurre cuando trato de obtener un token de acceso.
request_token = request.cookies['request_token']
token = oauth.OAuthToken.from_string(request_token)
twitter = OAuthApi(app_globals.CONSUMER_KEY, app_globals.CONSUMER_SECRET, token) # everything works good
access_token = twitter.getAccessToken() # then, i receive the error.
¿Alguna idea? ¡Gracias!