parameters: (
          self, request_token, request_token_secret, request=None, uri=None
      )
return_statement: return oauth_token, oauth_token_secret
docstring: Step 3 of the flow: Parse the response and fetch token.
docstring_summary: Step 3 of the flow: Parse the response and fetch token.
docstring_tokens: Step 3 of the flow : Parse the response and fetch token .
function: def handle_authorization_callback(
          self, request_token, request_token_secret, request=None, uri=None
      ):
          """Step 3 of the flow: Parse the response and fetch token."""
          session = OAuth1Session(
              self.client_key,
              client_secret=self.client_secret,
              resource_owner_key=request_token,
              resource_owner_secret=request_token_secret,
          )
  
          if not uri:
              uri = request.build_absolute_uri() + "?" + request.META.get("QUERY_STRING", "")
          session.parse_authorization_response(uri)
  
          try:
              res = session.fetch_access_token(self.ACCESS_TOKEN_URL)
          except requests.exceptions.RequestException as e:
              raise RequestError("Request error fetching access token.", e)
          except (TokenRequestDenied, TokenMissing) as e:
              raise AuthError("Auth error fetching access token.", e)
  
          oauth_token = res.get("oauth_token")
          oauth_token_secret = res.get("oauth_token_secret")
          return oauth_token, oauth_token_secret
function_tokens: def handle_authorization_callback ( self , request_token , request_token_secret , request = None , uri = None ) : session = OAuth1Session ( self . client_key , client_secret = self . client_secret , resource_owner_key = request_token , resource_owner_secret = request_token_secret , ) if not uri : uri = request . build_absolute_uri ( ) + "?" + request . META . get ( "QUERY_STRING" , "" ) session . parse_authorization_response ( uri ) try : res = session . fetch_access_token ( self . ACCESS_TOKEN_URL ) except requests . exceptions . RequestException as e : raise RequestError ( "Request error fetching access token." , e ) except ( TokenRequestDenied , TokenMissing ) as e : raise AuthError ( "Auth error fetching access token." , e ) oauth_token = res . get ( "oauth_token" ) oauth_token_secret = res . get ( "oauth_token_secret" ) return oauth_token , oauth_token_secret