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

Support RSA SecurIDv2Authentication #241

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
15 changes: 9 additions & 6 deletions aws_adfs/_rsa_authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,20 @@ def _context(html_response):
return element.get('value')


def _retrieve_roles_page(roles_page_url, context, session, ssl_verification_enabled,
rsa_securid_code):
def _retrieve_roles_page(html_response, roles_page_url, context, session, ssl_verification_enabled, rsa_securid_code):
auth_query = './/input[@id="authMethod"]'
element = html_response.find(auth_query)
authMethod = element.get("value")

response = session.post(
roles_page_url,
verify=ssl_verification_enabled,
allow_redirects=True,
data={
'AuthMethod': 'SecurIDAuthentication',
'Context': context,
'Passcode': rsa_securid_code,
}
"AuthMethod": authMethod,
"Context": context,
"Passcode": rsa_securid_code,
},
)
trace_http_request(response)

Expand Down
8 changes: 4 additions & 4 deletions aws_adfs/authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,12 @@ def _is_symantec_vip_authentication(html_response):
):
return True


def _is_rsa_authentication(html_response):
auth_method = './/input[@id="authMethod"]'
element = html_response.find(auth_method)
return (
element is not None
and element.get('value') == 'SecurIDAuthentication'
)
return element is not None and element.get("value") in ("SecurIDAuthentication", "SecurIDv2Authentication")


def _is_azure_mfa_authentication(html_response):
auth_method = './/input[@id="authMethod"]'
Expand All @@ -186,6 +185,7 @@ def _is_azure_mfa_authentication(html_response):
and element.get('value') == 'AzureMfaServerAuthentication'
)


def _is_azure_cloud_mfa_authentication(html_response):
auth_method = './/input[@id="authMethod"]'
element = html_response.find(auth_method)
Expand Down