def auth_user_remote_user(self, username):
user = self.find_user(username=username)<EOL>if user is None and self.auth_user_registration:<EOL><INDENT>user = self.add_user(<EOL>username=username,<EOL>first_name=username,<EOL>last_name="<STR_LIT:->",<EOL>email="<STR_LIT:->",<EOL>role=self.find_role(self.auth_user_registration_role),<EOL>)<EOL><DEDENT>elif user is None or (not user.is_active):<EOL><INDENT>log.info(LOGMSG_WAR_SEC_LOGIN_FAILED.format(username))<EOL>return None<EOL><DEDENT>self.update_user_auth_stat(user)<EOL>return user<EOL>
REMOTE_USER user Authentication

:param username: user's username for remote auth
:type self: User model