Closed anikfal closed 8 months ago
Hi @anikfal, can you tell me which version of sentinelhub-py
you are using? In version 3.9.2
we added a patch for the recent changes in credential handling.
Hi @zigaLuksic. It seems the version is okay:
import sentinelhub
sentinelhub.__version__
'3.9.3'
I can use 2 separate sentinel hub dashboards:
I created the credentials by the second dashboard (shapps.dataspace.copernicus.eu
) . The first one seems not to be free.
Hi @anikfal can you confirm that when you create your profile specific to Copernicus Data Space Ecosystem you are inputting all of the below parameters?
config = SHConfig()
config.sh_client_id = getpass.getpass("Enter your SentinelHub client id")
config.sh_client_secret = getpass.getpass("Enter your SentinelHub client secret")
config.sh_token_url = "https://identity.dataspace.copernicus.eu/auth/realms/CDSE/protocol/openid-connect/token"
config.sh_base_url = "https://sh.dataspace.copernicus.eu"
config.save("cdse")
It's important to set the token url
and base url
parameters as the default parameters for sentinelhub-py
won't work with Copernicus Data Space Ecosystem.
For some up to date examples on using sentinelhub-py
with Copernicus Data Space Ecosystem I would recommend going through this notebook.
Hi @willrayeo. Problem solved. Thanks for mentioning those critical points.
I had not set config.sh_token_url
and config.sh_base_url
in my config.toml
(no need to config.save("cdse")
for my case). So they had some other addresses (https://services.sentinel-hub.com/oauth/token
and https://services.sentinel-hub.com
).
I wonder if it was necessary to establish two separate services (services.sentinel-hub.com
and sh.dataspace.copernicus.eu
)? It was a bit confusing for me as the user.
I have successfully created the
sh_client_id
andsh_client_secret
parameters. However, while trying the code below, it raisesBad request
error:Last three lines of the error:
I am sure about the validity of the credentials, since I can get a token by the same credentials, by the command below: