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

Add --use-device-code as an option in config #9098

Open
2 tasks
anthonyma94 opened this issue Nov 22, 2024 · 6 comments
Open
2 tasks

Add --use-device-code as an option in config #9098

anthonyma94 opened this issue Nov 22, 2024 · 6 comments
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue sso

Comments

@anthonyma94
Copy link

anthonyma94 commented Nov 22, 2024

Describe the feature

In order to use aws sso login on non-local computers, you have to pass in --use-device-code. This should be an option as users who need to use the option will presumably always need to. Adding an option in the config as a convenience will be helpful.

Use Case

Having to always add the flag when logging in is annoying.

Proposed Solution

Add a login type in config:

[sso-session default]
...
login_type = device | pkce

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CLI version used

2.22.2

Environment details (OS name and version, etc.)

Ubuntu 24.04

@anthonyma94 anthonyma94 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Nov 22, 2024
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Nov 22, 2024
@RyanFitzSimmonsAK RyanFitzSimmonsAK added sso p2 This is a standard priority issue needs-review This issue or pull request needs review from a core team member. and removed needs-triage This issue or PR still needs to be triaged. labels Nov 22, 2024
@ashovlin
Copy link
Member

We intentionally started with just --use-device-code. Our thinking was to shift usage to the newly recommended authorization code flow by requiring a more explicit intent to fallback rather than setting once.

But I understand that can be frequent on non-local computers. We'll gather interest via this issue for a profile option.

@RyanFitzSimmonsAK RyanFitzSimmonsAK removed the needs-review This issue or pull request needs review from a core team member. label Nov 25, 2024
@RyanFitzSimmonsAK RyanFitzSimmonsAK removed their assignment Nov 26, 2024
@Dalzhim
Copy link

Dalzhim commented Dec 5, 2024

I have just run into this issue. I have a workflow where aws-cli is part of a docker container. The new PKCE-based Authorization flow doesn't work at all in that context. First: it can't open a browser from within the container. Second: when I copy the URL into my local browser, I then authorize the connection and I get redirected to an error page because whoever is listening for that redirect is not on the local machine. I need to start a new remote-shell, execute an additional bash process within the same container and curl the redirect url so that the login flow can resume correctly. So overall, --use-device-code is unavoidable in this flow, and having it as part of the saved profile would help a lot.

@michaelbutleridt
Copy link

michaelbutleridt commented Dec 11, 2024

In a related issue, it seems we cannot use --use-device-code when running aws configure sso which I was going to instruct users to run for the first time to set up their config. However, when running aws configure sso it assumes it will run in a same-device context, and has to use the 127.0.0.1 callback URL which will result in an error screen.

Please also support --use-device-code with aws configure sso wizard.

EDIT: fixed in later package version!

@Dalzhim
Copy link

Dalzhim commented Dec 12, 2024

@michaelbutleridt: aws configure sso --use-device-code is working fine on my end, it might be an unrelated issue (using aws-cli/2.22.10 Python/3.12.6 Linux/6.8.0-47-generic exe/aarch64.ubuntu.22).

@ashovlin
Copy link
Member

@Dalzhim - the Docker anecdote is helpful for prioritization, thanks for writing that up.

@michaelbutleridt - --use-device-code for aws configure sso wasn't working at launch (2.22.0), but should be working in 2.22.2 or greater now. Let us know your --version value if you're still seeing issues.

@michaelbutleridt
Copy link

michaelbutleridt commented Dec 12, 2024

I have aws-cli/2.22.14 Python/3.12.6 Linux/6.8.0-1018-aws exe/x86_64.ubuntu.22 (Ubuntu 22.04 with awscli Snap package) and indeed it is working now. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue sso
Projects
None yet
Development

No branches or pull requests

5 participants