diff --git a/apricot/oauth/oauth_client.py b/apricot/oauth/oauth_client.py index 0baa8f6..5087f7c 100644 --- a/apricot/oauth/oauth_client.py +++ b/apricot/oauth/oauth_client.py @@ -91,12 +91,15 @@ def bearer_token(self: Self) -> str: try: if not self.bearer_token_: log.msg("Requesting a new authentication token from the OAuth backend.") + log.msg(f"client_id '{self.session_application._client.client_id}'") + log.msg(f"client_secret '{self.client_secret}'") json_response = self.session_application.fetch_token( token_url=self.token_url, client_id=self.session_application._client.client_id, client_secret=self.client_secret, ) self.bearer_token_ = self.extract_token(json_response) + log.msg(f"bearer_token '{self.bearer_token_}'") except Exception as exc: msg = f"Failed to fetch bearer token from OAuth endpoint.\n{exc!s}" raise RuntimeError(msg) from exc @@ -164,7 +167,7 @@ def query_(*args: Any, **kwargs: Any) -> requests.Response: result.raise_for_status() except (TokenExpiredError, requests.exceptions.HTTPError) as exc: log.msg(str(exc)) - log.msg("Authentication token has expired.") + log.msg("Authentication token is invalid.") self.bearer_token_ = None result = query_(*args, **kwargs) if result.status_code == HTTPStatus.NO_CONTENT: