Versent / saml2aws

CLI tool which enables you to login and retrieve AWS temporary credentials using a SAML IDP
https://github.com/Versent/saml2aws
MIT License
2.07k stars 562 forks source link

emacs eterm configure: failed to input configuration: error selecting provider file: bad input #400

Closed xee5ch closed 3 years ago

xee5ch commented 4 years ago

Similar to #341, I get the following error with saml2aws configure -a test in emacs with eterm and multi-term shell emulator, I get the following error the moment I press the up/down buttons to select the IdP type.

$ saml2aws configure -a test
? Please choose a provider:  [Use arrows to move, type to filter]
❯ ADFS
  ADFS2
  Akamai
  AzureAD
  F5APM
  GoogleApps
  JumpCloud
failed to input configuration: error selecting provider file: bad input
wolfeidau commented 4 years ago

I need to see if this is caused by the library I am using for term input. Would you mind testing one of their examples?

https://github.com/AlecAivazis/survey/tree/v1.8.7

Cheers

ErgaBerga commented 4 years ago

@wolfeidau I'm getting the same error on Linux Mint 19.3 Tricia (based on Ubuntu 18.04.3 LTS).

When I run 'saml2aws configure' and press enter on ADFS I get "failed to input configuration: error selecting provider file: bad input". I assume this is the same issue as listed above.

$ saml2aws configure ? Please choose a provider: ### pressed enter here on default ADFS failed to input configuration: error selecting provider file: bad input

I found a workaround that if I hold the down arrow and loop around the list and then hit enter on ADFS it works. I have to press the down arrow multiple times on each prompt to get through the UI.

I have run the requested examples from https://github.com/AlecAivazis/survey/tree/v1.8.7 as below:

$ sudo apt-get install git golang-go $ go get gopkg.in/AlecAivazis/survey.v1 $ cd ~/go/src/gopkg.in/AlecAivazis/survey.v1/

$ go run examples/simple.go ? What is your name? Go Run Examples/Validation.Go ? Choose a color: red Go Run Examples/Validation.Go chose red. $ go run examples/validation.go ? What is your name? Blah X Sorry, your reply was invalid: You entered not foo, not 'foo'. ? Enter 'foo': foo $ go run examples/longlist.go ? Choose a letter: a you chose a. ###--- Note this appears to be the same list UI and pressing enter on the default works fine here.

I can reproduce the error by moving my ~/.saml2aws file out of the way and rerunning saml2aws configure. Having an empty file there also causes the error.

$ mv ~/.saml2aws ~/tmp/ $ saml2aws configure ? Please choose a provider: ###pressed enter here failed to input configuration: error selecting provider file: bad input $ mv ~/tmp/.saml2aws ~/ $ saml2aws configure ###pressed enter ~6 times ? Please choose a provider: ADFS ? Please choose an MFA Auto ? AWS Profile saml ? URL ###myurl prefilled here ? Username ###myuser prefilled here ? Password No password supplied

account { URL: ###myurl posted here Username: ###myuser posted here Provider: ADFS MFA: Auto SkipVerify: false AmazonWebservicesURN: urn:amazon:webservices SessionDuration: 3600 Profile: saml RoleARN: }

Configuration saved for IDP account: default

w13k commented 4 years ago

I have the same issue on my MacBook running on Catalina, zsh and saml2aws version 2.24.0. I've tried the workaround from @ErgaBerga and it worked. But still not the best situation.

stobias123 commented 4 years ago

also seeing this on osx+zsh

aditya-mittal commented 4 years ago

Have noticed this on MacOs Mojave, zsh and saml2aws version 2.27.0. Trying the work-around suggested by @ErgaBerga worked for me.

str3tch commented 3 years ago

Yep this tool does not work for me on Mac, Catalina and zsh

▶ saml2aws configure
? Please choose a provider:
failed to input configuration: error selecting provider file: bad input

▶ saml2aws configure
? Please choose a provider: ADFS2
? Please choose an MFA
failed to input configuration: error selecting mfa: bad input

Projects/Code                                                                                                                                     
▶ saml2aws configure
? Please choose a provider: ADFS
? Please choose an MFA
failed to input configuration: error selecting mfa: bad input
jpedro commented 3 years ago

I created a trash profile using GoogleApps and some random username and password. After that I configured it properly with the correct ADFS and it just worked. I'm guessing the 1st configure created the files correctly.

Commands and output:

$ saml2aws configure
? Please choose a provider: GoogleApps
? AWS Profile saml
? URL wergh
? Username asdfgh
? Password ******
? Confirm ******
account {
  URL: wergh
  Username: asdfgh
  Provider: GoogleApps
  MFA: Auto
  SkipVerify: false
  AmazonWebservicesURN: urn:amazon:webservices
  SessionDuration: 3600
  Profile: saml
  RoleARN:
  Region:
}
Configuration saved for IDP account: default

$ saml2aws configure
? Please choose a provider: ADFS
? Please choose an MFA Auto
? AWS Profile saml
? URL https://az2sts.REDACTED.com/adfs/ls/IdpInitiatedSignon.aspx
? Username user.name@REDACTED.com
? Password *****************
? Confirm *****************
account {
  URL: https://az2sts.REDACTED.com/adfs/ls/IdpInitiatedSignon.aspx
  Username: user.name@REDACTED.com
  Provider: ADFS
  MFA: Auto
  SkipVerify: false
  AmazonWebservicesURN: urn:amazon:webservices
  SessionDuration: 3600
  Profile: saml
  RoleARN:
  Region:
}
Configuration saved for IDP account: default
pizeyt commented 3 years ago

Using Windows 10 and git-bash:

$ saml2aws --version 2.28.0 $ saml2aws configure ? Please choose a provider: [Use arrows to move, type to filter]

ADFS ADFS2 Akamai AzureAD F5APM GoogleApps JumpCloud failed to input configuration: error selecting provider file: bad input