Skip to content

Commit

Permalink
(HP-1699): revert settings, add header to fetch_token
Browse files Browse the repository at this point in the history
  • Loading branch information
george42-ctds committed Sep 18, 2024
1 parent bfd534b commit 0e76a2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion wts/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ def load_settings(app):
"redirect_uri": redirect_uri,
"scope": scope,
"state_prefix": state_prefix,
"headers": {"User-Agent": "Gen3WTS / 0.4.3"},
}

app.config["COMMONS_HOSTNAMES"] = list(
Expand Down
6 changes: 5 additions & 1 deletion wts/resources/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ def client_do_authorize():
if mismatched_state:
raise AuthError("could not authorize; state did not match across auth requests")
try:
tokens = client.fetch_token(token_url, **flask.request.args.to_dict())
tokens = client.fetch_token(
token_url,
**flask.request.args.to_dict(),
headers={"User-Agent": "Gen3WTS / 0.4.3"}
)
refresh_refresh_token(tokens, requested_idp, username_field)
except KeyError as e:
raise AuthError("error in token response: {}".format(tokens))
Expand Down

0 comments on commit 0e76a2d

Please sign in to comment.