def authentication_ok(self):
username = None<EOL>password = None<EOL>if self.authCallback:<EOL><INDENT>if self.authNeedUser:<EOL><INDENT>username = self.readline(prompt=self.PROMPT_USER, use_history=False)<EOL><DEDENT>if self.authNeedPass:<EOL><INDENT>password = self.readline(echo=False, prompt=self.PROMPT_PASS, use_history=False)<EOL>if self.DOECHO:<EOL><INDENT>self.write("<STR_LIT:\n>")<EOL><DEDENT><DEDENT>try:<EOL><INDENT>self.authCallback(username, password)<EOL><DEDENT>except:<EOL><INDENT>self.username = None<EOL>return False<EOL><DEDENT>else:<EOL><INDENT>self.username = username<EOL>return True<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.username = None<EOL>return True<EOL><DEDENT>
Checks the authentication and sets the username of the currently connected terminal.  Returns True or False