def get_auth_string(auth_or_path):
    """Retrieves authentication string from string or file.

    Args:
        auth_or_path (str): Authentication string or path to file containing it

    Returns:
        str: Authentication string.

    """
    if ":" in auth_or_path:
        return auth_or_path
    try:
        with open(auth_or_path) as stream:
            content = stream.read()
            content = content.strip()
            if ":" in content:
                return content
    except FileNotFoundError:
        pass
    raise ValueError(auth_or_path)