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

When self.factor is set to a type not available from okta, program crashes #209

Open
EStallings opened this issue Feb 24, 2023 · 0 comments

Comments

@EStallings
Copy link
Contributor

Describe the bug
When self.factor is set to a type not available from okta (which happens if you change your okta mfa settings) program crashes with this error:

  File "/usr/local/bin/okta-awscli", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/oktaawscli/okta_awscli.py", line 141, in main
    get_credentials(
  File "/usr/local/lib/python3.9/site-packages/oktaawscli/okta_awscli.py", line 36, in get_credentials
    _, assertion = okta.get_assertion()
  File "/usr/local/lib/python3.9/site-packages/oktaawscli/okta_auth.py", line 156, in get_assertion
    self.session_token = self.primary_auth()
  File "/usr/local/lib/python3.9/site-packages/oktaawscli/okta_auth.py", line 59, in primary_auth
    session_token = mfa_base.verify_mfa(factors_list)
  File "/usr/local/lib/python3.9/site-packages/oktaawscli/okta_auth_mfa_base.py", line 71, in verify_mfa
    supported_factors[factor_choice]['provider'])
UnboundLocalError: local variable 'factor_choice' referenced before assignment
    Error: Command failed: okta-awscli --okta-profile global --profile global --verbose

To Reproduce
Steps to reproduce the behavior:

  1. Edit your okta file or your okta mfa settings
  2. Attempt to login via okta-awscli

Expected behavior
At a minimum a more informative error message would help clarify what's going on

Environment (please complete the following information):

  • OS: MacOS
  • Version of okta-awscli you're running: 0.5.4
@EStallings EStallings changed the title When When self.factor is set to a type not available from okta, program crashes Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant