Skip to content

Commit

Permalink
OIDC debug logging: show bit more detail on token response
Browse files Browse the repository at this point in the history
Also make sure it is shown for device code flow
  • Loading branch information
soxofaan committed Jun 18, 2024
1 parent 2574094 commit 14854ce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion openeo/rest/auth/oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,15 @@ def _do_token_post_request(self, post_data: dict) -> dict:
)

result = resp.json()
log.debug("Token response with keys {k}".format(k=result.keys()))
return result

def _get_access_token_result(self, data: dict, expected_nonce: str = None) -> AccessTokenResult:
"""Parse JSON result from token request"""
redacted = {
k: v if k in ["expires_in", "refresh_expires_in", "token_type", "scope"] else "<redacted>"
for k, v in data.items()
}
log.debug(f"Extracting access token result from token response {redacted}")
return AccessTokenResult(
access_token=self._extract_token(data, "access_token"),
id_token=self._extract_token(data, "id_token", expected_nonce=expected_nonce, allow_absent=True),
Expand Down

0 comments on commit 14854ce

Please sign in to comment.