From 8920092e6e5a5f6ddf59185b202553a94abdc208 Mon Sep 17 00:00:00 2001 From: grensburg Date: Thu, 29 Feb 2024 10:44:00 +0100 Subject: [PATCH] change token endpoint used by basic auth --- rest/authentication/authentication.py | 2 +- tests/setup_tests.py | 2 +- tests/test_units.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rest/authentication/authentication.py b/rest/authentication/authentication.py index c4dc7e77..6ec9bd4d 100644 --- a/rest/authentication/authentication.py +++ b/rest/authentication/authentication.py @@ -129,7 +129,7 @@ def check_credentials_basic(self): username, password = self.parse_credentials_from_header() secret = password if len(password) <= 50 else base64.b64decode(bytes(password, "ascii")).decode("ascii") r = requests.post( - "https://services.sentinel-hub.com/oauth/token", + "https://services.sentinel-hub.com/auth/realms/main/protocol/openid-connect/token", data={ "grant_type": "client_credentials", "client_id": username, diff --git a/tests/setup_tests.py b/tests/setup_tests.py index 819b21c8..1981a405 100644 --- a/tests/setup_tests.py +++ b/tests/setup_tests.py @@ -161,7 +161,7 @@ def set_valid_sh_token(): raise Exception("This test needs SH_CLIENT_ID and SH_CLIENT_SECRET env vars to be set.") r = requests.post( - "https://services.sentinel-hub.com/oauth/token", + "https://services.sentinel-hub.com/auth/realms/main/protocol/openid-connect/token", data={ "grant_type": "client_credentials", "client_id": SH_CLIENT_ID, diff --git a/tests/test_units.py b/tests/test_units.py index f786c675..84e2993c 100644 --- a/tests/test_units.py +++ b/tests/test_units.py @@ -691,7 +691,7 @@ def test_sentinel_hub_access_token(access_token): responses.add( responses.POST, - "https://services.sentinel-hub.com/oauth/token", + "https://services.sentinel-hub.com/auth/realms/main/protocol/openid-connect/token", body=json.dumps({"access_token": example_token, "expires_at": 2147483647}), )