#NEWLINE# def get_authenticated_user( self , callback ) : #NEWLINE# #INDENT# "Gets the OAuth authorized user and access token on callback.\n\n        This method should be called from the handler for your registered\n        OAuth Callback URL to complete the registration process. We call\n        callback with the authenticated user, which in addition to standard\n        attributes like 'name' includes the 'access_key' attribute, which\n        contains the OAuth access you can use to make authorized requests\n        to this service on behalf of the user.\n        " #NEWLINE# request_key = self . get_argument ( 'oauth_token' ) #NEWLINE# oauth_verifier = self . get_argument ( 'oauth_verifier' ) #NEWLINE# request_cookie = self . get_cookie ( '_oauth_request_token' ) #NEWLINE# if ( not request_cookie ) : #NEWLINE# #INDENT# logging . warning ( 'Missing OAuth request token cookie' ) #NEWLINE# callback ( None ) #NEWLINE# return #NEWLINE# #UNINDENT# self . clear_cookie ( '_oauth_request_token' ) #NEWLINE# ( cookie_key , cookie_secret ) = request_cookie . split ( '|' ) #NEWLINE# if ( cookie_key != request_key ) : #NEWLINE# #INDENT# logging . warning ( 'Request token does not match cookie' ) #NEWLINE# callback ( None ) #NEWLINE# return #NEWLINE# #UNINDENT# token = dict ( key = cookie_key , secret = cookie_secret , verifier = oauth_verifier ) #NEWLINE# http = httpclient . AsyncHTTPClient ( ) #NEWLINE# http . fetch ( self . _oauth_access_token_url ( token ) , self . async_callback ( self . _on_access_token , callback ) )