Nike-Inc / gimme-aws-creds

A CLI that utilizes Okta IdP via SAML to acquire temporary AWS credentials
Apache License 2.0
925 stars 263 forks source link

Exception on authorization with duo hardware token #478

Open yermalov-here opened 1 month ago

yermalov-here commented 1 month ago

When trying to generate keys using Duo Universal login having a hardware token as the only device registered gimme-aws-creds throws and exception when parsing the login form data.

This happens as the login-form doesn't contain a "preferred_device" input.

Expected Behavior

Current Behavior

The following exception is thrown

  File "***/python3.10/site-packages/gimme_aws_creds/duo_universal.py", line 172, in _get_duo_universal_login_form_data
    preferred_device = self._find_device_to_use(doc)
  File "***/python3.10/site-packages/gimme_aws_creds/duo_universal.py", line 185, in _find_device_to_use
    device = doc.find('.//input[@name="preferred_device"]').get('value')
AttributeError: 'NoneType' object has no attribute 'get' 

This happens as the login-form doesn't contain a "preferred_device" input.

Possible Solution

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Context

Your Environment