Skip to content

Commit

Permalink
Merge pull request #112 from uc-cdis/fix/token
Browse files Browse the repository at this point in the history
update token aud
  • Loading branch information
mfshao authored Jul 15, 2024
2 parents 856f3fa + 12605c8 commit 13263f5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mds/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ async def create_object(
try:
# NOTE: token can be None if no Authorization header was provided, we expect
# this to cause a downstream exception since it is invalid
token_claims = await access_token("user", "openid", purpose="access")(token)
token_claims = await access_token(
"user", "openid", audience="openid", purpose="access"
)(token)
except Exception as e:
logger.error(e.detail if hasattr(e, "detail") else e, exc_info=True)
raise HTTPException(
Expand Down Expand Up @@ -181,7 +183,9 @@ async def create_object_for_id(
try:
# NOTE: token can be None if no Authorization header was provided, we expect
# this to cause a downstream exception since it is invalid
token_claims = await access_token("user", "openid", purpose="access")(token)
token_claims = await access_token(
"user", "openid", audience="openid", purpose="access"
)(token)
except Exception as e:
logger.error(e.detail if hasattr(e, "detail") else e, exc_info=True)
raise HTTPException(
Expand Down

0 comments on commit 13263f5

Please sign in to comment.