def get_auth_token(cloud, account, username, password, expected_status_code=None):
    """
    Get auth token from user login
    :param cloud: Cloud API object
    :param account: Account id
    :param username: User id
    :param password: Password
    :param expected_status_code: Asserts the result in the function
    :return: Auth token
    """
    r = cloud.iam.authenticate_user(account=account, username=username, password=password,
                                    expected_status_code=expected_status_code).json()['token']

    return r