def with_username(username, password):
    """
    To authenticate a user with user and password
    *** authenticate doesn't create a session. To create a session, 
    use login_user
    :param username: 
    :param password: 
    :return: UserModel
    """
    user = models.AuthUser.get_by_username(username)
    return _user(user) if user and user.password_matched(password) else None
To authenticate a user with user and password
    *** authenticate doesn't create a session. To create a session, 
    use login_user
    :param username: 
    :param password: 
    :return: UserModel