From 9208b58cdc3bdfaf14eb8fdd810d44c0ef5a7ada Mon Sep 17 00:00:00 2001 From: Simen Fivelstad Smaaberg <66635118+simensma-fresh@users.noreply.github.com> Date: Fri, 11 Aug 2023 09:20:22 -0700 Subject: [PATCH] [MDS-5414] Fixed auth issue with some integrations in test env (#2628) MDS-5414 Fixed auth issue with some integrations in test env Co-authored-by: simensma-fresh --- services/core-api/app/extensions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/core-api/app/extensions.py b/services/core-api/app/extensions.py index 3caacf5cf7..9ce9664334 100644 --- a/services/core-api/app/extensions.py +++ b/services/core-api/app/extensions.py @@ -28,7 +28,9 @@ def get_jwt_by_audience(aud): } for audience_env, jwt_value in audience_jwt_map.items(): - if os.environ.get(audience_env) in aud: + token_audience = os.environ.get(audience_env) + + if token_audience and token_audience in aud: return jwt_value return None