Skip to content

Commit

Permalink
fix(aud): Update validate_request calls
Browse files Browse the repository at this point in the history
  • Loading branch information
vpsx committed Feb 16, 2021
1 parent ec60cb0 commit 2b5aa17
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion fence/blueprints/data/indexd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion fence/blueprints/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 2b5aa17

Please sign in to comment.