Skip to content

Commit

Permalink
change token endpoint used by basic auth
Browse files Browse the repository at this point in the history
  • Loading branch information
guss84 committed Feb 29, 2024
1 parent 1b82bec commit 8920092
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rest/authentication/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/setup_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}),
)

Expand Down

0 comments on commit 8920092

Please sign in to comment.