def _oauth2_init(self, provider, auth_url):
        key, secret, scope = self._get_consumer_info_for(provider)
        callback_url = self._callback_uri_for(provider)

        if key and secret and auth_url and callback_url:
            params = { 'response_type': 'code', 'client_id': key, 'redirect_uri': callback_url }
            if scope:
                params.update(scope=scope)

            target_url = auth_url.format(urlencode(params))
            logging.debug('Redirecting user to %s' % target_url)

            self.redirect(target_url)

        else:
            logging.error('Provider %s is not supported' % provider)
            self._provider_not_supported(provider)
Initiates OAuth 2.0 dance. Falls back to self._provider_not_supported(provider)
dataset/ETHPy150Open ibagrak/algae/gae/libs/simpleauth/handler.py/SimpleAuthHandler._oauth2_init