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

Output full URL including code when using login --headless #113

Open
oviliz opened this issue Sep 28, 2023 · 2 comments
Open

Output full URL including code when using login --headless #113

oviliz opened this issue Sep 28, 2023 · 2 comments

Comments

@oviliz
Copy link

oviliz commented Sep 28, 2023

When using aws-cli's login --no-browser the CLI output also includes the URL with the code so you do a single copy and paste. E.g.:

❯ aws sso login --profile my-profile --no-browser
Browser will not be automatically opened.
Please visit the following URL:

https://device.sso.eu-west-1.amazonaws.com/

Then enter the code:

HJRZ-HIWR

**Alternatively, you may visit the following URL which will autofill the code upon loading:
https://device.sso.eu-west-1.amazonaws.com/?user_code=HJRZ-HIWR**

It would be nice to have something like that here when using the --headless option. Currently outputs like this:

❯ aws-sso-util login --force-refresh --headless
Logging in https://d-12345678e9.awsapps.com/start
Identity Center login required.
Open the following URL in a browser:

https://device.sso.eu-west-1.amazonaws.com/

Then enter the code:

HJRZ-HIWR

Also, apologies for using this for an added question. If we don't want to use the --headless, is there a way to choose the browser in MacOS other than the default?

@oviliz
Copy link
Author

oviliz commented Sep 28, 2023

Hmm, apparently you already have that in https://github.com/benkehoe/aws-sso-util/blob/master/lib/aws_sso_lib/browser.py but I'm not experiencing it for some reason.

❯ aws-sso-util --version
4.32.0

👀

@ahublersos
Copy link

I see the same issue, also on 4.32.0. Release notes from that version indicate it should contain the new messages from #92, but I still see the same messages that @oviliz has above with no mention of the autofill urls.

❯ aws-sso-util login --force-refresh
Logging in https://foo.awsapps.com/start
Login with IAM Identity Center required.
Attempting to open the authorization page in your default browser.
If the browser does not open or you wish to use a different device to
authorize this request, open the following URL:

https://device.sso.us-east-1.amazonaws.com/

Then enter the code:

RSJB-PMFH
❯ aws-sso-util login --force-refresh --headless
Logging in https://foo.awsapps.com/start
Identity Center login required.
Open the following URL in a browser:

https://device.sso.us-east-1.amazonaws.com/

Then enter the code:

GPLD-LRBB

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

No branches or pull requests

2 participants