diff --git a/src/authutils/user.py b/src/authutils/user.py index 6dae606..a3b86ab 100644 --- a/src/authutils/user.py +++ b/src/authutils/user.py @@ -11,7 +11,12 @@ def set_current_user(**kwargs): - flask.g.user = CurrentUser(**kwargs) + expected_audience = flask.current_app.config.get("USER_API") + # Gen3 services use both USER_API and BASE_URL + if not expected_audience: + expected_audience = flask.current_app.config.get("BASE_URL") + + flask.g.user = CurrentUser(jwt_kwargs={"audience": expected_audience}, **kwargs) set_current_token(flask.g.user._claims) return flask.g.user