def authenticate(self, user, password):
        with self.post("/v3/user/authenticate", {"user": user, "password": password}) as res:
            code, body = res.status, res.read()
            if code != 200:
                self.raise_error("Authentication failed", res, body)
            js = self.checked_json(body, ["apikey"])
            apikey = js["apikey"]
            return apikey
TODO: add docstring
dataset/ETHPy150Open treasure-data/td-client-python/tdclient/user_api.py/UserAPI.authenticate