Skip to content

Commit

Permalink
update get_account_aliases to use httpClient
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Aureliano da Silva Maia committed Oct 23, 2023
1 parent 29be467 commit 6027c4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tokendito/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ def get_account_aliases(saml_xml, saml_response_string):
encoded_xml = codecs.encode(saml_xml.encode("utf-8"), "base64")
aws_response = None
try:
aws_response = requests.Session().post(url, data={"SAMLResponse": encoded_xml})
aws_response = HTTP_client.post(url, data={"SAMLResponse": encoded_xml})
except Exception as request_error:
logger.error(f"There was an error retrieving the AWS SAML page: \n{request_error}")
logger.debug(json.dumps(aws_response))
Expand Down Expand Up @@ -1217,7 +1217,7 @@ def request_cookies(url, session_token):
logger.debug(f"Requesting session cookies from {url}")

# Use the HTTP client to make a POST request.
response = HTTP_client.post(url, json=data, headers=headers) # Note the use of json parameter
response = HTTP_client.post(url, json=data, headers=headers)

# Handle response errors if necessary
if response.status_code != 200:
Expand Down

0 comments on commit 6027c4f

Please sign in to comment.