async def METHOD_NAME(
    http_client, content_type_map, auth_creds, subtests, client_config
):
    """
    Test valid logins
    """
    with subtests.test("Test in form encoded"):
        response = await http_client.fetch(
            "/login",
            method="POST",
            body=urllib.parse.urlencode(auth_creds),
            headers={"Content-Type": content_type_map["form"]},
        )
        cookies = response.headers["Set-Cookie"]
        assert response.code == 200
        response_obj = salt.utils.json.loads(response.body)["return"][0]
        token = response_obj["token"]
        assert "session_id={}".format(token) in cookies
        perms = response_obj["perms"]
        perms_config = client_config["external_auth"]["auto"][auth_creds["username"]]
        assert set(perms) == set(perms_config)
        assert "token" in response_obj  # TODO: verify that its valid?
        assert response_obj["user"] == auth_creds["username"]
        assert response_obj["eauth"] == auth_creds["eauth"]
    with subtests.test("Test in JSON"):
        response = await http_client.fetch(
            "/login",
            method="POST",
            body=salt.utils.json.dumps(auth_creds),
            headers={"Content-Type": content_type_map["json"]},
        )
        cookies = response.headers["Set-Cookie"]
        assert response.code == 200
        response_obj = salt.utils.json.loads(response.body)["return"][0]
        token = response_obj["token"]
        assert "session_id={}".format(token) in cookies
        perms = response_obj["perms"]
        perms_config = client_config["external_auth"]["auto"][auth_creds["username"]]
        assert set(perms) == set(perms_config)
        assert "token" in response_obj  # TODO: verify that its valid?
        assert response_obj["user"] == auth_creds["username"]
        assert response_obj["eauth"] == auth_creds["eauth"]
    with subtests.test("Test in YAML"):
        response = await http_client.fetch(
            "/login",
            method="POST",
            body=salt.utils.yaml.safe_dump(auth_creds),
            headers={"Content-Type": content_type_map["yaml"]},
        )
        cookies = response.headers["Set-Cookie"]
        assert response.code == 200
        response_obj = salt.utils.json.loads(response.body)["return"][0]
        token = response_obj["token"]
        assert "session_id={}".format(token) in cookies
        perms = response_obj["perms"]
        perms_config = client_config["external_auth"]["auto"][auth_creds["username"]]
        assert set(perms) == set(perms_config)
        assert "token" in response_obj  # TODO: verify that its valid?
        assert response_obj["user"] == auth_creds["username"]
        assert response_obj["eauth"] == auth_creds["eauth"]