ESAP API seems to not like valid tokens that differ from the internal ESAP one
I am trying to use the shopping basket from a DLaaS instance that does not authenticate against ESCAPE IAM, but of course to get the basket from ESAP will need a token authenticated against it.
To this end I installed the oidc-agent and generate a token from the command line, which I then use in the shopping basket (using the token=
argument to the shopping_client.ShoppingClient
object. However this fails with the error:
/home/jovyan/.local/lib/python3.8/site-packages/esap_client/shopping_client.py:90: UserWarning: Unable to load data from https://sdc-dev.astron.nl/esap-api:5555; is your key valid?
warn(f"Unable to load data from {self.host}; is your key valid?")
I disagree with the warning: the token is perfectly valid. If I take the token from ESAP itself (by clicking the key icon) all works fine. So what I think happens is that authentication happens against the token in ESAPs database in stead of making a call to IAM (or whatever one does to check IAM token validity).
I think it is a bug in ESAP, but if it is not, then I would like to propose changing the warning/documentation accordingly :D