From 7abb307ed83151378ee8829e0edbddbbfd99a248 Mon Sep 17 00:00:00 2001 From: Bruno Gutierrez Rios Date: Fri, 6 Dec 2024 16:43:23 -0300 Subject: [PATCH] La 164 checking oauth access token regeneration (#5548) Co-authored-by: Adrian Galvan --- CHANGELOG.md | 3 ++- src/fides/api/models/connectionconfig.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db499e3ed4..36ff4660bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,8 @@ The types of changes are: ### Added - New page in the Cookie House sample app to demonstrate the use of embedding the FidesJS SDK on the page [#5564](https://github.com/ethyca/fides/pull/5564) - +### Fixed +- SaaS integrations using `oauth_client_credentials` now properly update their access token when editing the secrets. ## [2.51.0](https://github.com/ethyca/fides/compare/2.50.0...2.51.0) diff --git a/src/fides/api/models/connectionconfig.py b/src/fides/api/models/connectionconfig.py index 0859c516b2..1758222b88 100644 --- a/src/fides/api/models/connectionconfig.py +++ b/src/fides/api/models/connectionconfig.py @@ -220,10 +220,10 @@ def authorized(self) -> bool: return False # hard-coding to avoid cyclic dependency - if authentication.strategy != "oauth2_authorization_code": + if authentication.strategy not in ["oauth2_authorization_code", "oauth2_client_credentials"]: return False - return bool(self.secrets and self.secrets.get("access_token")) + return bool(self.secrets and 'access_token' in self.secrets.keys()) @property def name_or_key(self) -> str: