Public Member Functions | |
def | authorize_redirect |
def | get_authenticated_user |
Private Member Functions | |
def | _oauth_access_token_url |
def | _oauth_get_user |
def | _oauth_request_parameters |
def | _oauth_request_token_url |
def | _on_access_token |
def | _on_oauth_get_user |
def | _on_request_token |
Abstract implementation of OAuth. See TwitterMixin and FriendFeedMixin below for example implementations.
def tornado.auth.OAuthMixin._oauth_access_token_url | ( | self, | |
request_token | |||
) | [private] |
def tornado.auth.OAuthMixin._oauth_get_user | ( | self, | |
access_token, | |||
callback | |||
) | [private] |
Reimplemented in tornado.auth.GoogleMixin, tornado.auth.FriendFeedMixin, and tornado.auth.TwitterMixin.
def tornado.auth.OAuthMixin._oauth_request_parameters | ( | self, | |
url, | |||
access_token, | |||
parameters = {} , |
|||
method = "GET" |
|||
) | [private] |
def tornado.auth.OAuthMixin._oauth_request_token_url | ( | self, | |
callback_uri = None , |
|||
extra_params = None |
|||
) | [private] |
def tornado.auth.OAuthMixin._on_access_token | ( | self, | |
callback, | |||
response | |||
) | [private] |
def tornado.auth.OAuthMixin._on_oauth_get_user | ( | self, | |
access_token, | |||
callback, | |||
user | |||
) | [private] |
def tornado.auth.OAuthMixin._on_request_token | ( | self, | |
authorize_url, | |||
callback_uri, | |||
response | |||
) | [private] |
def tornado.auth.OAuthMixin.authorize_redirect | ( | self, | |
callback_uri = None , |
|||
extra_params = None , |
|||
http_client = None |
|||
) |
Redirects the user to obtain OAuth authorization for this service. Twitter and FriendFeed both require that you register a Callback URL with your application. You should call this method to log the user in, and then call get_authenticated_user() in the handler you registered as your Callback URL to complete the authorization process. This method sets a cookie called _oauth_request_token which is subsequently used (and cleared) in get_authenticated_user for security purposes.
def tornado.auth.OAuthMixin.get_authenticated_user | ( | self, | |
callback, | |||
http_client = None |
|||
) |
Gets the OAuth authorized user and access token on callback. This method should be called from the handler for your registered OAuth Callback URL to complete the registration process. We call callback with the authenticated user, which in addition to standard attributes like 'name' includes the 'access_key' attribute, which contains the OAuth access you can use to make authorized requests to this service on behalf of the user.