

@return_future
def authenticate_redirect(self, callback_uri=None, cancel_uri=None, extended_permissions=None, callback=None):
    'Authenticates/installs this app for the current user.\n\n        .. versionchanged:: 3.1\n           Returns a `.Future` and takes an optional callback.  These are\n           not strictly necessary as this method is synchronous,\n           but they are supplied for consistency with\n           `OAuthMixin.authorize_redirect`.\n        '
    self.require_setting('facebook_api_key', 'Facebook Connect')
    callback_uri = (callback_uri or self.request.uri)
    args = {
        'api_key': self.settings['facebook_api_key'],
        'v': '1.0',
        'fbconnect': 'true',
        'display': 'page',
        'next': urlparse.urljoin(self.request.full_url(), callback_uri),
        'return_session': 'true',
    }
    if cancel_uri:
        args['cancel_url'] = urlparse.urljoin(self.request.full_url(), cancel_uri)
    if extended_permissions:
        if isinstance(extended_permissions, (unicode_type, bytes_type)):
            extended_permissions = [extended_permissions]
        args['req_perms'] = ','.join(extended_permissions)
    self.redirect(('http://www.facebook.com/login.php?' + urllib_parse.urlencode(args)))
    callback()

dataset/ETHPy150Open D-L/SimpleBookMarks/src/tornado/auth.py FacebookMixin.authenticate_redirect/original