sentinel-hub/sentinelhub-py

invalid_client [HELP]

stamatisvas opened this issue · 2 comments

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?

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.

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