feature:Allow configuration of a preferred_mfa_provider #446
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Allows for configuration of a preferred mfa provider which is used to more precisely select an available preferred mfa factor by filtering the list of available factors by provider in addition to type. This allows, for instance, a user to have setup both Google totp and Okta push and to have a preferred default used by gimme-aws-creds; currently in this situation, the user must select their preferred mfa factor at runtime as gimme-aws-creds will see both available and default to prompting the user to select one.
Related Issue
#445
Motivation and Context
In order to give myself options, I have both Google Authenticator and Okta Verify setup. In the past, I have disabled Okta Verify so that gimme-aws-creds only has one totp mfa to find, but this seems like an unnecessary concession.
How Has This Been Tested?
While using an Okta account with both Google Authenticator and Okta Verify setup:
preferred_mfa_type = token:software:totp
andpreferred_mfa_provider = GOOGLE
in the global config, the user is prompted for an authentication token from Google.preferred_mfa_type = token:software:totp
andpreferred_mfa_provider = OKTA
in the global config, the user is prompted for an authentication token from Okta.preferred_mfa_type = token:software:totp
andpreferred_mfa_provider = GOOGLE
in an account configuration, the use is prompted for an authentication token from Google.preferred_mfa_type = token:software:totp
andpreferred_mfa_provider = OKTA
in an account config, the user is prompted for an authentication token from Okta.preferred_mfa_type
orpreferred_mfa_provider
configured, the user is prompted to select a factor as they were previously.preferred_mfa_type = token:software:totp
andpreferred_mfa_provider
unset, the user is prompted to select a factor as they were previously when a preferred type is configured.I do not use DUO, and I am unaware of which other combinations of factors might be affected by this. I specifically included logic to avoid filtering out all potential factors if none match the preferred provider to minimize potential confusion.
Screenshots (if appropriate):
Types of changes
Checklist: