Skip to content

Commit

Permalink
Merge pull request #82 from Versent/refactor_simpify_configure
Browse files Browse the repository at this point in the history
refactor(Configure) Simplify the MFA configuration.
  • Loading branch information
wolfeidau authored Nov 5, 2017
2 parents 7d8b14a + dd24d84 commit db8951b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions input.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ func PromptForConfigurationDetails(idpAccount *cfg.IDPAccount) error {

mfas := MFAsByProvider.Mfas(idpAccount.Provider)

idpAccount.MFA, err = promptForSelection("\nPlease choose an MFA you would like to use:\n", mfas)
if err != nil {
return errors.Wrap(err, "error selecting provider file")
// only prompt for MFA if there is more than one option
if len(mfas) > 1 {
idpAccount.MFA, err = promptForSelection("\nPlease choose an MFA you would like to use:\n", mfas)
if err != nil {
return errors.Wrap(err, "error selecting provider file")
}

} else {
idpAccount.MFA = mfas[0]
}

fmt.Println("")
Expand Down
2 changes: 1 addition & 1 deletion saml2aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type ProviderList map[string][]string
var MFAsByProvider = ProviderList{
"ADFS": []string{"None", "VIP"},
"ADFS2": []string{"None"},
"Ping": []string{"PingID"},
"Ping": []string{"Auto"}, // automatically detects PingID
"JumpCloud": []string{"None"},
"Okta": []string{"Auto"}, // automatically detects DUO, SMS and ToTP
"KeyCloak": []string{"Auto"}, // automatically detects ToTP
Expand Down

0 comments on commit db8951b

Please sign in to comment.