cevoaustralia / aws-google-auth

Provides AWS STS credentials based on Google Apps SAML SSO auth (what a jumble!)
MIT License
538 stars 179 forks source link

Using keystore has unicode issue #72

Open stevemac007 opened 6 years ago

stevemac007 commented 6 years ago

I've successfully logged in and stored a password in the keystore, when I attempt to reauthenticate it fails with a unicode issue.

$ aws-google-auth -p cevo-dev --duration 43200 -k
Failed to import U2F libraries, U2F login unavailable. Other methods can still continue.
Traceback (most recent call last):
  File "/usr/local/bin/aws-google-auth", line 11, in <module>
    load_entry_point('aws-google-auth', 'console_scripts', 'aws-google-auth')()
  File "/Users/steve.mactaggart/development/cevo/aws-google-auth/aws_google_auth/__init__.py", line 224, in main
    cli(cli_args)
  File "/Users/steve.mactaggart/development/cevo/aws-google-auth/aws_google_auth/__init__.py", line 63, in cli
    process_auth(args, config)
  File "/Users/steve.mactaggart/development/cevo/aws-google-auth/aws_google_auth/__init__.py", line 181, in process_auth
    config.raise_if_invalid()
  File "/Users/steve.mactaggart/development/cevo/aws-google-auth/aws_google_auth/configuration.py", line 117, in raise_if_invalid
    assert (self.password.__class__ is str), "Expected password to be a string. Got {}.".format(self.password.__class__)

AssertionError: Expected password to be a string. Got <type 'unicode'>.
bsideup commented 6 years ago

I can confirm. Python 2

Workaround: change aws_google_auth/__init__.py, in process_auth, replace:

config.password = keyring_password

with:

config.password = str(keyring_password)