def _plain_auth_in_stage2(self, username, _unused, stanza):
password=stanza.xpath_eval("<STR_LIT>",{"<STR_LIT:a>":"<STR_LIT>"})<EOL>if password:<EOL><INDENT>password=from_utf8(password[<NUM_LIT:0>].getContent())<EOL><DEDENT>if not password:<EOL><INDENT>self.__logger.debug("<STR_LIT>")<EOL>iq=stanza.make_error_response("<STR_LIT>")<EOL>self.send(iq)<EOL>return<EOL><DEDENT>if self.check_password(username,password):<EOL><INDENT>iq=stanza.make_result_response()<EOL>self.send(iq)<EOL>self.peer_authenticated=True<EOL>self.auth_method_used="<STR_LIT>"<EOL>self.state_change("<STR_LIT>",self.peer)<EOL>self._post_auth()<EOL><DEDENT>else:<EOL><INDENT>self.__logger.debug("<STR_LIT>")<EOL>iq=stanza.make_error_response("<STR_LIT>")<EOL>e=iq.get_error()<EOL>e.add_custom_condition('<STR_LIT>',"<STR_LIT>")<EOL>self.send(iq)<EOL><DEDENT>
Handle the second stage (<iq type='set'/>) of legacy "plain"
        authentication.

        [server only]