Nike-Inc / gimme-aws-creds

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

2 okta push instead of 1 #439

Closed infa-ddeore closed 8 months ago

infa-ddeore commented 9 months ago

recently gimme-aws-creds started doing 2 okta push instead of 1

Expected Behavior

there should be only 1 okta push

Current Behavior

$ gimme-aws-creds -p dev Using password from keyring for xxxxx Multi-factor Authentication required. Okta Verify App: SmartPhone_IPhone: iPhone selected Okta Verify push sent... Multi-factor Authentication required. Okta Verify App: SmartPhone_IPhone: iPhone selected Okta Verify push sent... Pick a role:

Possible Solution

i dont have clue on this

Steps to Reproduce (for bugs)

  1. run gimme-aws-creds

Context

it requires to accept 2 okta pushes

Your Environment

epierce commented 8 months ago

Run gimme-aws-creds --action-register-device and make sure the Device Token gets updated in your config file.

infa-ddeore commented 8 months ago

thanks @epierce for response, still getting 2 push notifications after doing gimme-aws-creds --action-register-device

$ gimme-aws-creds --action-register-device
Using password from keyring for xxxx
Multi-factor Authentication required.
Okta Verify App: SmartPhone_IPhone: iPhone selected
Okta Verify push sent...

Device token saved!

2 push notifications:

$ gimme-aws-creds -p dev
Using password from keyring for xxxx
Multi-factor Authentication required.
Okta Verify App: SmartPhone_IPhone: iPhone selected
Okta Verify push sent...
Multi-factor Authentication required.
Okta Verify App: SmartPhone_IPhone: iPhone selected
Okta Verify push sent...
Pick a role:

anything else to look/ try for? there is no DEBUG option to the cli as well which could show more verbose logs to see what is happening

nolan-m commented 8 months ago

thanks @epierce for response, still getting 2 push notifications after doing gimme-aws-creds --action-register-device

$ gimme-aws-creds --action-register-device
Using password from keyring for xxxx
Multi-factor Authentication required.
Okta Verify App: SmartPhone_IPhone: iPhone selected
Okta Verify push sent...

Device token saved!

2 push notifications:

$ gimme-aws-creds -p dev
Using password from keyring for xxxx
Multi-factor Authentication required.
Okta Verify App: SmartPhone_IPhone: iPhone selected
Okta Verify push sent...
Multi-factor Authentication required.
Okta Verify App: SmartPhone_IPhone: iPhone selected
Okta Verify push sent...
Pick a role:

anything else to look/ try for? there is no DEBUG option to the cli as well which could show more verbose logs to see what is happening

I was having this issue too and figured out the solution.

Running gimme-aws-creds --action-register-device will only update the device token for the default profile. If you are using more than one profile, they will each have their own device_token set. Open your .okta_aws_login_config and update the device token for each profiles. Just copy it from the default profile. You could probably also run the --action-register-device with a profile flag, but I haven't tried that.

infa-ddeore commented 8 months ago

Running gimme-aws-creds --action-register-device will only update the device token for the default profile. If you are using more than one profile, they will each have their own device_token set. Open your .okta_aws_login_config and update the device token for each profiles. Just copy it from the default profile. You could probably also run the --action-register-device with a profile flag, but I haven't tried that

thanks @nolan-m, copying device_token from default to other profiles is working fine now!