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

"aws configure sso" fails unhelpfully with invalid SSO session names #7643

Closed
gbenson opened this issue Feb 6, 2023 · 3 comments
Closed
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue sso

Comments

@gbenson
Copy link

gbenson commented Feb 6, 2023

Describe the bug

aws configure sso fails with a cryptic error message if an invalid SSO session name is supplied.

Expected Behavior

It'd be nice to have an informative error message:

$ aws configure sso
SSO session name (Recommended): AWS on Chromebook

Error: "AWS on Chromebook" is not a valid session name (try "aws-on-chromebook" instead?)

Current Behavior

$ aws configure sso
SSO session name (Recommended): AWS on Chromebook
SSO start URL [None]: https://whatever.awsapps.com/start
SSO region [None]: us-east-1
SSO registration scopes [sso:account:access]:

An error occurred (InvalidClientMetadataException) when calling the RegisterClient operation:

There's nothing more, the command terminates there. Possibly a traceback got eaten somewhere?

Reproduction Steps

Run aws configure sso and give it an SSO session name with whitespace in it.

Possible Solution

No response

Additional Information/Context

No response

CLI version used

aws-cli/2.9.21

Environment details (OS name and version, etc.)

Python/3.9.11 Linux/5.10.153-20434-g98da1eb2cf9d exe/x86_64.debian.11 prompt/off

@gbenson gbenson added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 6, 2023
@tim-finnigan tim-finnigan self-assigned this Feb 7, 2023
@tim-finnigan tim-finnigan added investigating This issue is being investigated and/or work is in progress to resolve the issue. sso and removed needs-triage This issue or PR still needs to be triaged. labels Feb 7, 2023
@tim-finnigan
Copy link
Contributor

Thanks @gbenson for reporting this issue, I could reproduce the behavior you described. It looks like a client-side validator could be added here to ensure that the SSO Session Name doesn't contain spaces:

def prompt_for_sso_session(self, required=True):
prompt_text = 'SSO session name'
prompt_fmt = None
validator_cls = None
if required:
validator_cls = RequiredInputValidator
if not self.sso_session:
prompt_fmt = f'{prompt_text}: '
if not required:
prompt_fmt = f'{prompt_text} (Recommended): '
sso_session = self._prompt_for(
'sso_session', prompt_text,
completions=sorted(self._sso_sessions),
toolbar=self._get_sso_session_toolbar,
validator_cls=validator_cls,
prompt_fmt=prompt_fmt,
current_value=self.sso_session,
)
self.sso_session = sso_session
return sso_session

@tim-finnigan tim-finnigan added p2 This is a standard priority issue and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Feb 7, 2023
@tim-finnigan tim-finnigan removed their assignment Feb 7, 2023
@tim-finnigan tim-finnigan self-assigned this Oct 29, 2024
@tim-finnigan
Copy link
Contributor

Upon revisiting this and testing again, it appears that the issue has since been fixed. Please update to a recent version (2.18.16 is the latest per the CHANGELOG) and let us know if you're still seeing any issues.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue sso
Projects
None yet
Development

No branches or pull requests

2 participants