sentinel-hub / sentinelhub-py

Download and process satellite imagery in Python using Sentinel Hub services.
http://sentinelhub-py.readthedocs.io/en/latest/
MIT License
815 stars 249 forks source link

invalid_client [HELP] #523

Closed stamatisvas closed 8 months ago

stamatisvas commented 8 months ago

Hi,

I trying to follow the https://github.com/sentinel-hub/sentinelhub-py/blob/master/examples/process_request.ipynb

and when typing true_color_imgs = request_true_color.get_data()

I am getting the error: InvalidClientError: (invalid_client) Invalid client or Invalid client credentials

If I change the config to this setup: config = SHConfig() config.sh_client_id = 'sh-.....' config.sh_client_secret = 'my_pass' config.sh_base_url = 'https://sh.dataspace.copernicus.eu' config.sh_token_url = 'https://identity.dataspace.copernicus.eu/auth/realms/CDSE/protocol/openid-connect/token'

The error is changing to:

DownloadFailedException: Failed to download from: https://services.sentinel-hub.com/api/v1/process with HTTPError: 401 Client Error: Unauthorized for url: https://services.sentinel-hub.com/api/v1/process Server response: "{"status": 401, "reason": "Unauthorized", "message": "You are not authorized! Please provide a valid access token within the header [Authorization: Bearer ] of your request.", "code": "COMMON_UNAUTHORIZED"}"

I am pretty sure I am using the correct credentials. Any help?

zigaLuksic commented 8 months ago

Hi @stamatisvas it seems like you are using the copernicus dataspace ecosystem. The documentation also has custom tailored examples for that. Try following that and see if it helps.

stamatisvas commented 8 months ago

Following the provided examples, everything seems to work, thank you!