def authenticate_redirect(self, callback_uri=None, cancel_uri=None,
                              extended_permissions=None):
        callback_uri = callback_uri or self.request.path
        args = {
            'api_key':        self._facebook_api_key,
            'v':              '1.0',
            'fbconnect':      'true',
            'display':        'page',
            'next':           urlparse.urljoin(self.request.url, callback_uri),
            'return_session': 'true',
        }
        if cancel_uri:
            args['cancel_url'] = urlparse.urljoin(self.request.url, cancel_uri)

        if extended_permissions:
            if isinstance(extended_permissions, basestring):
                extended_permissions = [extended_permissions]

            args['req_perms'] = ','.join(extended_permissions)

        return self.redirect('http://www.facebook.com/login.php?' +
                        urllib.urlencode(args))
Authenticates/installs this app for the current user.
dataset/ETHPy150Open moraes/tipfy/tipfy/auth/facebook.py/FacebookMixin.authenticate_redirect