EO-College / cubes-and-clouds

This is the official repository for the online course 'Cubes & Clouds'
Creative Commons Attribution 4.0 International
31 stars 9 forks source link

openEO on EDC with SentinelHub as backend #5

Closed przell closed 1 year ago

przell commented 1 year ago

We (@clausmichele and me, both through the personal account and the master asi conae account) tried to connect to SentinelHubs openEO backend via EDC as we had discussed. Our approach doesn't work. We time out when using the authentication method relying on client secret and id. Check the notebook here: https://github.com/EO-College/cubes-and-clouds/blob/main/exercises/edc_openeo.ipynb FYI: Via EGI and our existing Eurac accounts it works. But that's not what we want.

thx for cheking with me @clausmichele can you tell us how it should work? @Schpidi, @UndeadFairy, @dthiex

clausmichele commented 1 year ago

I put the code here as well for simplicity:

import openeo
from sentinelhub import (SHConfig, SentinelHubRequest, DataCollection, MimeType, CRS, BBox, bbox_to_dimensions, geometry)

conn = openeo.connect('https://jjdxlu8vwl.execute-api.eu-central-1.amazonaws.com/production')
config = SHConfig()
config.sh_client_id = %env SH_CLIENT_ID
config.sh_client_secret = %env SH_CLIENT_SECRET

conn.authenticate_oidc_authorization_code(client_id=config.sh_client_id, client_secret=config.sh_client_secret)
guss84 commented 1 year ago

If I understand correctly, you want to authenticate to your Sentinel Hub account and not EGI account, by using the client_id and client_secret provided by Sentinel Hub?

We do not currently support the authenticate_oidc_authorization_code method, but a work around to this would be using authenticate_basic for example:

conn.authenticate_basic(username=config.sh_client_id, password=config.sh_client_secret)
clausmichele commented 1 year ago

It works, thanks!