How to login into the AWS SSO using AWS CLI without needing browser?

0

Hello, I want to login into the AWS SSO using AWS CLI, but i want to use only CMD , without interacting with browser , is there any solutions for this?

  • Do you want to connect to any AWS account using the SSO parameters?

1回答
4
承認された回答

The answer here is 'no'. As part of the AuthN process when you're working with AWS SSO programmatically, a browser must be used so that you can authorise the CLI client.

What you can do here is the following:

  • Use a preferred browser.
  • Skip a webpage by going to the 'verificationUriComplete' instead of 'verificationUri' (These are output fields from the 'StartDeviceAuthorization' call of the 'SSO-OIDC' API suite). The former being the verification URI, with the OTP 'userCode' included.

What you can do is create a script of your own which automates everything up until the point where you simply have to click on 'Authorize' on the web browser page that opens before you, due to the script. That's what I ended up doing through PowerShell and the AWS Tools for PowerShell.

profile pictureAWS
回答済み 2年前
  • Okay, thank you for your time and answer, from the answer and some googling i understood that i can only "authenticate" in AWS SSO using AWS CLI trough HTTPS requests/answers (because this is how AWS api works?)? If im right, then everything could be "scripted", but anyway, can you share your powershell scripts (and maybe in any other language) regarding this "automation" ?

  • What is the way then to access Amazon services, like the one I need - TTS Polly? Do I always need a browser? I just try to follow the docs (unsuccessfully) and at this browser step which even doesn't work. But thinking about the future usage of my tool, dependence on a browser would just render it useless. I'm totally confused really.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ