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

fly login asks for choosing auth method #2819

Closed
elgohr opened this issue Aug 20, 2018 · 9 comments

Comments

@elgohr
Copy link

@elgohr elgohr commented Aug 20, 2018

In case you have multiple auth methods configured (e.g. UAA & Basic Auth) fly asks you to choose one and blocks for input since 4.0.0. This also happens when you already provide username and password and makes it unusable for scripting.

fly -t x login -n aTeam -c https://my.ci -u userName -p password  
logging in to team 'x'  
1: UAA  
2: Basic Auth  
choose an auth method (2):  
@elgohr

This comment has been minimized.

Copy link
Author

@elgohr elgohr commented Oct 31, 2018

Workaround: Use fly cli in version <= 3 for login and perform a sync afterwards.

@vito vito transferred this issue from concourse/fly Nov 19, 2018
@jama22 jama22 added fly core/flow and removed core/flow labels Nov 19, 2018
@xtremerui

This comment has been minimized.

Copy link
Contributor

@xtremerui xtremerui commented Nov 20, 2018

Could not repo this on v4.2.1. Is it possible for you to try this on latest version? Thx.

@elgohr

This comment has been minimized.

Copy link
Author

@elgohr elgohr commented Nov 24, 2018

Same on v4.2.2. Serverside we're running 3.14.1

@xtremerui

This comment has been minimized.

Copy link
Contributor

@xtremerui xtremerui commented Nov 26, 2018

hmm this is what I got

fly -t push login -c https://xxxxxx.ci.cf-app.com  -n main -u ci -p xxxxxxx
logging in to team 'main'

1: GitHub
2: Basic Auth
choose an auth method (2): 2


target saved

with latest fly and concourse v3.14.1

Just to make sure, after you picked 1 or 2, the stdin input is swallowed and you would have to kill it by ctrl-c ? Does it happen all the time or just occasionally?

@elgohr

This comment has been minimized.

Copy link
Author

@elgohr elgohr commented Nov 26, 2018

The problem is that I have to choose between 1 & 2 via stdin. How would you automate this selection in a script so that it's understandable for everybody?

@xtremerui

This comment has been minimized.

Copy link
Contributor

@xtremerui xtremerui commented Nov 26, 2018

Can't you just pipe an input to your fly command?

echo 2 | fly ..... will pick option 2 with non-interactive input

@elgohr

This comment has been minimized.

Copy link
Author

@elgohr elgohr commented Nov 26, 2018

So you consider echo 2 to be understandable for everybody?

Additionally every script would have to be potentially adjusted when the order changes/an additional authentication provider is configured.

But I will try this as an additional workaround

@xtremerui

This comment has been minimized.

Copy link
Contributor

@xtremerui xtremerui commented Nov 26, 2018

I see. This seems like a regression that being broken long time ago (traced back to v3.14.2 when we worked on adding legacy auth support) so I mistakenly thought it was expected behaviour. It shouldn't ask for input if username and password are provided.
Thx for reporting!

xtremerui added a commit that referenced this issue Nov 30, 2018
@jama22 jama22 added the accepted label Dec 3, 2018
@jama22 jama22 closed this Dec 3, 2018
@elgohr

This comment has been minimized.

Copy link
Author

@elgohr elgohr commented Dec 3, 2018

So this is the commit?
00f0ab4

@vito vito added this to the v5.0.0 milestone Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.