def process_slo(self, keep_local_session=False, request_id=None, delete_session_cb=None):
self.__errors = []<EOL>self.__error_reason = None<EOL>if '<STR_LIT>' in self.__request_data and '<STR_LIT>' in self.__request_data['<STR_LIT>']:<EOL><INDENT>logout_response = OneLogin_Saml2_Logout_Response(self.__settings, self.__request_data['<STR_LIT>']['<STR_LIT>'])<EOL>self.__last_response = logout_response.get_xml()<EOL>if not logout_response.is_valid(self.__request_data, request_id):<EOL><INDENT>self.__errors.append('<STR_LIT>')<EOL>self.__error_reason = logout_response.get_error()<EOL><DEDENT>elif logout_response.get_status() != OneLogin_Saml2_Constants.STATUS_SUCCESS:<EOL><INDENT>self.__errors.append('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>self.__last_message_id = logout_response.id<EOL>if not keep_local_session:<EOL><INDENT>OneLogin_Saml2_Utils.delete_local_session(delete_session_cb)<EOL><DEDENT><DEDENT><DEDENT>elif '<STR_LIT>' in self.__request_data and '<STR_LIT>' in self.__request_data['<STR_LIT>']:<EOL><INDENT>logout_request = OneLogin_Saml2_Logout_Request(self.__settings, self.__request_data['<STR_LIT>']['<STR_LIT>'])<EOL>self.__last_request = logout_request.get_xml()<EOL>if not logout_request.is_valid(self.__request_data):<EOL><INDENT>self.__errors.append('<STR_LIT>')<EOL>self.__error_reason = logout_request.get_error()<EOL><DEDENT>else:<EOL><INDENT>if not keep_local_session:<EOL><INDENT>OneLogin_Saml2_Utils.delete_local_session(delete_session_cb)<EOL><DEDENT>in_response_to = logout_request.id<EOL>self.__last_message_id = logout_request.id<EOL>response_builder = OneLogin_Saml2_Logout_Response(self.__settings)<EOL>response_builder.build(in_response_to)<EOL>self.__last_response = response_builder.get_xml()<EOL>logout_response = response_builder.get_response()<EOL>parameters = {'<STR_LIT>': logout_response}<EOL>if '<STR_LIT>' in self.__request_data['<STR_LIT>']:<EOL><INDENT>parameters['<STR_LIT>'] = self.__request_data['<STR_LIT>']['<STR_LIT>']<EOL><DEDENT>security = self.__settings.get_security_data()<EOL>if '<STR_LIT>' in security and security['<STR_LIT>']:<EOL><INDENT>parameters['<STR_LIT>'] = security['<STR_LIT>']<EOL>parameters['<STR_LIT>'] = self.build_response_signature(logout_response, parameters.get('<STR_LIT>', None), security['<STR_LIT>'])<EOL><DEDENT>return self.redirect_to(self.get_slo_url(), parameters)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.__errors.append('<STR_LIT>')<EOL>raise OneLogin_Saml2_Error(<EOL>'<STR_LIT>',<EOL>OneLogin_Saml2_Error.SAML_LOGOUTMESSAGE_NOT_FOUND<EOL>)<EOL><DEDENT>
Process the SAML Logout Response / Logout Request sent by the IdP.

:param keep_local_session: When false will destroy the local session, otherwise will destroy it
:type keep_local_session: bool

:param request_id: The ID of the LogoutRequest sent by this SP to the IdP
:type request_id: string

:returns: Redirection URL