1
gino OP class signin_sina(RequestHandler,WeiboMixin):
@tornado.web.asynchronous def get(self): next = self.get_argument("next",None) state = self.get_argument("state", None) redirect_uri = SINA_redirect_uri if self.get_argument("code", False): self.get_authenticated_user( redirect_uri = redirect_uri, client_id = SINA_CONSUMER_KEY, client_secret = SINA_CONSUMER_SECRET, code = self.get_argument("code"), callback = self.async_callback(self._on_login,state)) return self.authorize_redirect( redirect_uri = redirect_uri, client_id = SINA_CONSUMER_KEY, extra_params={"response_type": "code","state": next}, ) def _on_login(self, user): print user print 'uuuuu' self.finish() Handler是这样的,没有任何输出,但是登录sina是成功了 |
2
raptium 2012-11-17 14:41:00 +08:00
callback = self.async_callback(self._on_login,state))
所以你的 user 就是 state ? |