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

Push notification MFA fails with: KeyError: 'next' #192

Open
MattTheRed opened this issue May 12, 2022 · 1 comment
Open

Push notification MFA fails with: KeyError: 'next' #192

MattTheRed opened this issue May 12, 2022 · 1 comment

Comments

@MattTheRed
Copy link

MattTheRed commented May 12, 2022

Describe the bug
The CLI is failing on the MFA step with a "next" keyerror. Oddly enough when I put a breakpoint in, I see that resp_json['_links']['next']['href'] is in fact set.

To Reproduce
Steps to reproduce the behavior:

  1. Run okta-awscli --debug

Expected behavior
Should not fail on MFA step

Output

okta-awscli --debug
DEBUG - Setting AWS role to arn:aws:iam::546291546746:role/staging-mmoore
DEBUG - Setting AWS partition to AwsPartition.AWS
DEBUG - Setting MFA factor to OKTA
ERROR - The app-link is missing. Will try to retrieve it from Okta
INFO - Authenticating to: galileo.okta.com
INFO - Authenticating as: mmoore@galileo.io
Enter password: 
ERROR - Unsupported factorType: sms
INFO - Using pre-selected factor choice                                          from ~/.okta-aws
INFO - Performing secondary authentication using: OKTA
DEBUG - {'id': 'opf1395moyZwb1PLX4h7', 'factorType': 'push', 'provider': 'OKTA', 'vendorName': 'OKTA', 'profile': {'credentialId': 'mmoore@galileo.io', 'deviceType': 'SmartPhone_IPhone', 'keys': [{'kty': 'EC', 'use': 'sig', 'kid': 'default', 'x': 'Sdnlgvi62N1b5KyDKgEoT-mH59N2HTDcaBiIFcG--GQ', 'y': 'E5CBsNP1hJ07ZZTEHmOts-W9gOxbnEZ8eT_GoWgQKPs', 'crv': 'P-256'}], 'name': 'Matt’s iPhone', 'platform': 'IOS', 'version': '14.8.1'}, '_links': {'verify': {'href': 'https://galileo.okta.com/api/v1/authn/factors/opf1395moyZwb1PLX4h7/verify', 'hints': {'allow': ['POST']}}}}
Waiting for push verification...
Traceback (most recent call last):
  File "/Users/matt/.pyenv/versions/3.8.0/bin/okta-awscli", line 8, in <module>
    sys.exit(main())
  File "/Users/matt/.pyenv/versions/3.8.0/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/matt/.pyenv/versions/3.8.0/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/matt/.pyenv/versions/3.8.0/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/matt/.pyenv/versions/3.8.0/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/matt/.pyenv/versions/3.8.0/lib/python3.8/site-packages/oktaawscli/okta_awscli.py", line 141, in main
    get_credentials(
  File "/Users/matt/.pyenv/versions/3.8.0/lib/python3.8/site-packages/oktaawscli/okta_awscli.py", line 36, in get_credentials
    _, assertion = okta.get_assertion()
  File "/Users/matt/.pyenv/versions/3.8.0/lib/python3.8/site-packages/oktaawscli/okta_auth.py", line 153, in get_assertion
    self.session_token = self.primary_auth()
  File "/Users/matt/.pyenv/versions/3.8.0/lib/python3.8/site-packages/oktaawscli/okta_auth.py", line 59, in primary_auth
    session_token = mfa_base.verify_mfa(factors_list)
  File "/Users/matt/.pyenv/versions/3.8.0/lib/python3.8/site-packages/oktaawscli/okta_auth_mfa_base.py", line 73, in verify_mfa
    session_token = self._verify_single_factor(supported_factors[factor_choice])
  File "/Users/matt/.pyenv/versions/3.8.0/lib/python3.8/site-packages/oktaawscli/okta_auth_mfa_base.py", line 103, in _verify_single_factor
    resp_json['_links']['next']['href'], json=req_data)
KeyError: 'next'

Environment (please complete the following information):

  • OS: MacOS, python 3.8
  • Version of okta-awscli you're running. 0.5.3

Additional context

@maxtacu
Copy link
Member

maxtacu commented May 13, 2022

Hey @MattTheRed can you check please if the issue persists with the latest version 0.5.4?

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

2 participants