def _oauth1_init(self, provider, auth_urls):
        key, secret = self._get_consumer_info_for(provider)
        callback_url = self._callback_uri_for(provider)
        token_request_url = auth_urls.get('request', None)
        auth_url = auth_urls.get('auth', None)
        _parse = getattr(self, self.TOKEN_RESPONSE_PARSERS[provider], None)

        if not(key or secret or token_request_url or auth_url or callback_url or _parse):
            raise Exception('Provider %s is not supported' % provider)

        # make a request_token request
        client = self._oauth1_client(consumer_key=key, consumer_secret=secret)
        resp, content = client.request(auth_urls['request'], "GET")

        if resp.status != 200:
            raise Exception("Could not fetch a valid response from %s" % provider)

        # parse token request response
        request_token = _parse(content)
        if not request_token.get('oauth_token', None):
            raise Exception("Couldn't get a valid token from %s\n%s" % (provider, str(request_token)))

        target_url = auth_urls['auth'].format(urlencode({
          'oauth_token': request_token.get('oauth_token', None),
          'oauth_callback': callback_url
        }))

        logging.debug('Redirecting user to %s' % target_url)

        # save request token for later, the callback
        self.session['req_token'] = request_token
        self.redirect(target_url)
Initiates OAuth 1.0 dance
dataset/ETHPy150Open ibagrak/algae/gae/libs/simpleauth/handler.py/SimpleAuthHandler._oauth1_init