Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: drop user-agent header from requests as it only seems to cause issues, especially with Duo #410

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions aws_adfs/_duo_authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

_headers = {
'Accept-Language': 'en',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Accept': 'text/plain, */*; q=0.01',
}
Expand Down Expand Up @@ -418,7 +417,6 @@ def _initiate_authentication(duo_host, duo_request_signature, roles_page_url, se
verify=ssl_verification_enabled,
headers={
'Host': duo_host,
'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
'Accept-Language': "en-US,en;q=0.5",
'Accept-Encoding': "gzip, deflate, br",
Expand Down
3 changes: 0 additions & 3 deletions aws_adfs/_duo_universal_prompt_authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@

_headers = {
"Accept-Language": "en",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) like Gecko"
if platform.system() in ("Linux", "Darwin")
else "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"Accept": "text/plain, */*; q=0.01",
}
Expand Down
1 change: 0 additions & 1 deletion aws_adfs/account_aliases_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def account_aliases(session, username, password, auth_method, saml_response, con
verify=config.ssl_verification,
headers={
'Accept-Language': 'en',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Accept': 'text/plain, */*; q=0.01',
},
Expand Down