From 2b5aa1753c03ea967614a1795a837818608d6442 Mon Sep 17 00:00:00 2001 From: vpsx <19900057+vpsx@users.noreply.github.com> Date: Tue, 16 Feb 2021 12:14:21 -0600 Subject: [PATCH] fix(aud): Update validate_request calls --- fence/blueprints/data/indexd.py | 4 +++- fence/blueprints/link.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fence/blueprints/data/indexd.py b/fence/blueprints/data/indexd.py index 5a9b3e1f2..f0b1dcb5e 100644 --- a/fence/blueprints/data/indexd.py +++ b/fence/blueprints/data/indexd.py @@ -963,7 +963,9 @@ def _get_user_info(): populated information about an anonymous user. """ try: - set_current_token(validate_request(scope={"user"})) + set_current_token( + validate_request(scope={"user"}, audience=config.get("BASE_URL")) + ) user_id = str(current_token["sub"]) username = current_token["context"]["user"]["name"] except JWTError: diff --git a/fence/blueprints/link.py b/fence/blueprints/link.py index 988a52816..b77c587bf 100644 --- a/fence/blueprints/link.py +++ b/fence/blueprints/link.py @@ -274,7 +274,9 @@ def get(self): # if we're mocking google auth, mock response to include the email # from the provided access token try: - token = validate_request({"user"}) + token = validate_request( + scope={"user"}, audience=config.get("BASE_URL") + ) email = get_user_from_claims(token).username except Exception as exc: logger.info(