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

Fix keyring when using two different okta URLs with same username but different passwords #357

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ldeflandre
Copy link

Description

Creating PR on behalf of @ChaseWagoner that has perfectly describes the issue in #263 and come up with this change.

Related Issue

#263

Motivation and Context

I have one account in each of two Okta orgs (org1 and org2). The accounts have identical usernames (e.g. cwagoner), but unique passwords.

I configured a profile for each org, using e.g. https://org1.okta.com and https://org2.okta.com.

$ gimme-aws-creds --profile org1 and opt to save the password in the keyring. Keyring result (keys taken from macOS's Keychain Access):

Kind: application password
Account: cwagoner
Where: gimme-aws-creds

$ gimme-aws-creds --profile org2 output:

Using password from keyring for cwagoner
Stored password is invalid, clearing.  Please try again
LOGIN ERROR: Authentication failed | Error Code: E0000004

Undesirable results:

The password for cwagoner in org1 has been removed from the keyring; it must be entered again next time I use that profile.
If I run the second command again and enter the correct org2 password, I'll simply face the same issue the next time I try to use profile org1

How Has This Been Tested?

Using two okta profiles with same username but different okta_url, passwords for each profile are now correctly stored and used in a dedicated keyring entry.

> gimme-aws-creds --profile int
Using password from keyring for ldeflandre
Saving <role> as <aws_int_profile>
Written profile <aws_int_profile> to /Users/ldeflandre/.aws/credentials


> gimme-aws-creds --profile ext
Using password from keyring for ldeflandre
Multi-factor Authentication required.
Okta Verify App: SmartPhone_Android: <device> selected
Okta Verify push sent...
Saving <role> as <aws_ext_profile>
Written profile <aws_ext_profile> to /Users/ldeflandre/.aws/credentials

After upgrade previously stored password is invalidated.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@epierce
Copy link
Member

epierce commented Nov 23, 2022

What platforms have you tested this on? It works fine on macOS, but I want to make sure that the keyring handles the new username format on Windows

@ldeflandre
Copy link
Author

ldeflandre commented Nov 24, 2022 via email

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

Successfully merging this pull request may close these issues.

3 participants