def generate_authorize_url(self, callback="oob"):
    client = oauth2.Client(self.consumer)
    if callback:
      params = {
        'oauth_callback':callback
      }
    else:
      params = dict()

    resp, content = client.request(self.request_token_url, "POST", body=urllib.urlencode(params))
    request_token = dict(urlparse.parse_qsl(content))

    if "oauth_token" in request_token:
      oauth_token = request_token['oauth_token']
      self.request_tokens[oauth_token] = request_token
      return "%s?oauth_token=%s" % (self.authorize_url, oauth_token)
    else:
      print content
      if "Desktop applications only support the oauth_callback" in content:
        raise Exception("Twitter thinks this is a desktop app. Set a fake callback URL for the app at dev.twitter.com")
      else:
        raise Exception("Could not generate request token for authentication. Are the keys correct?")
Uses the given config to connect to the API and get a token with which
dataset/ETHPy150Open domrout/python-twitter-wrapper/twitterwrapper/access_tokens.py/AuthenticationProcess.generate_authorize_url