def authenticate_redirect(self, callback_uri=None, cancel_uri=None,<EOL>extended_permissions=None):
self.require_setting("<STR_LIT>", "<STR_LIT>")<EOL>callback_uri = callback_uri or self.request.uri<EOL>args = {<EOL>"<STR_LIT>": self.settings["<STR_LIT>"],<EOL>"<STR_LIT:v>": "<STR_LIT:1.0>",<EOL>"<STR_LIT>": "<STR_LIT:true>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": urlparse.urljoin(self.request.full_url(), callback_uri),<EOL>"<STR_LIT>": "<STR_LIT:true>",<EOL>}<EOL>if cancel_uri:<EOL><INDENT>args["<STR_LIT>"] = urlparse.urljoin(<EOL>self.request.full_url(), cancel_uri)<EOL><DEDENT>if extended_permissions:<EOL><INDENT>if isinstance(extended_permissions, (unicode, bytes_type)):<EOL><INDENT>extended_permissions = [extended_permissions]<EOL><DEDENT>args["<STR_LIT>"] = "<STR_LIT:U+002C>".join(extended_permissions)<EOL><DEDENT>self.redirect("<STR_LIT>" +<EOL>urllib.urlencode(args))<EOL>
Authenticates/installs this app for the current user.