@staticmethod<EOL><INDENT>def get_nameid_data(request, key=None):<DEDENT>
elem = OneLogin_Saml2_XML.to_etree(request)<EOL>name_id = None<EOL>encrypted_entries = OneLogin_Saml2_XML.query(elem, '<STR_LIT>')<EOL>if len(encrypted_entries) == <NUM_LIT:1>:<EOL><INDENT>if key is None:<EOL><INDENT>raise OneLogin_Saml2_Error(<EOL>'<STR_LIT>',<EOL>OneLogin_Saml2_Error.PRIVATE_KEY_NOT_FOUND<EOL>)<EOL><DEDENT>encrypted_data_nodes = OneLogin_Saml2_XML.query(elem, '<STR_LIT>')<EOL>if len(encrypted_data_nodes) == <NUM_LIT:1>:<EOL><INDENT>encrypted_data = encrypted_data_nodes[<NUM_LIT:0>]<EOL>name_id = OneLogin_Saml2_Utils.decrypt_element(encrypted_data, key)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>entries = OneLogin_Saml2_XML.query(elem, '<STR_LIT>')<EOL>if len(entries) == <NUM_LIT:1>:<EOL><INDENT>name_id = entries[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>if name_id is None:<EOL><INDENT>raise OneLogin_Saml2_ValidationError(<EOL>'<STR_LIT>',<EOL>OneLogin_Saml2_ValidationError.NO_NAMEID<EOL>)<EOL><DEDENT>name_id_data = {<EOL>'<STR_LIT>': OneLogin_Saml2_XML.element_text(name_id)<EOL>}<EOL>for attr in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>if attr in name_id.attrib:<EOL><INDENT>name_id_data[attr] = name_id.attrib[attr]<EOL><DEDENT><DEDENT>return name_id_data<EOL>
Gets the NameID Data of the the Logout Request
:param request: Logout Request Message
:type request: string|DOMDocument
:param key: The SP key
:type key: string
:return: Name ID Data (Value, Format, NameQualifier, SPNameQualifier)
:rtype: dict