Hi everyone, I'm new to Prefect and got a question...
# ask-community
k
Hi everyone, I'm new to Prefect and got a question around the api and authentication. I've setup a self hosted prefect on AWS EKS which is fronted by api-gateway to enable support for api keys when talking to the api. Now this works fine when I use for example curl to hit the api endpoint. I simply add the api key request header like this:
--header "x-api-key: XYZ123"
However when I try to use the prefect-client and supply the api-key like this
PrefectClient(api="<https://path.to.selfhosted.prefect.com/api>",api_key="XYZ123")
on the same endpoint I get a
Forbidden
message back from api-gateway. I suspect that the PrefectClient does not support the x-api-key format that api-gateway is expecting and that is why it's failing. So my question is: Would this work if I made api-gateway accept
"Authorization Bearer XYZ123"
or is PrefectClient using some other way of presenting the api key? Thanks!
For anyone wondering, I can confirm that it works.