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(