earthdaily / earthdaily-python-client

EarthDaily python client
https://earthdaily.github.io/earthdaily-python-client/
MIT License
11 stars 6 forks source link

APIError: {"message":"Forbidden"} #10

Closed robmarkcole closed 8 months ago

robmarkcole commented 10 months ago

I've noticed that if the API hasn't been queried for a while this error is raised. Calling earthdatastore.Auth() refreshes the connection and clears the error. We could consider this automatically

nkarasiak commented 10 months ago

Yes there's an one hour timeout of the authentification. It could be nice to automatically reauth() when this error pop.

nkarasiak commented 8 months ago

A way to handle easilly the reauth (need to be implemented inside the package)

resp = eds.client._stac_io.session.get(eds.client.get_self_href())
if resp.status_code == 403:
    eds = earthdaily.earthdatastore.Auth()