tilfinltd / aws-extend-switch-roles

Extend your AWS IAM switching roles by Chrome extension, Firefox add-on, or Edge add-on
https://chromewebstore.google.com/detail/aws-extend-switch-roles/jpmkfafbacpgapdghgdpembnojdlgkdl?utm_source=github
MIT License
1.32k stars 141 forks source link

Support both account aliases and numbers #132

Closed olfway closed 3 years ago

olfway commented 4 years ago

I've created an alias for my aws account and everything works if I enter alias on the login page

But if I enter account number instead then aws web UI shows my account as the number

[ROOT]
region = eu-central-1
aws_account_id = my-root

[ROOT-Admin]
source_profile = ROOT
region = eu-west-1
role_arn = arn:aws:iam::111111111111:role/AdminUser

maybe some other parameter could be used for an alias? like

[ROOT]
region = eu-central-1
aws_account_id = 111111111111
aws_account_alias = my-root

[ROOT-Admin]
source_profile = ROOT
region = eu-west-1
role_arn = arn:aws:iam::111111111111:role/AdminUser

or maybe account id can be parsed from the role_arn

tilfin commented 4 years ago

Why do you want to sign in with your AWS account ID as a number after set up the alias? This extension simply parses the only html of the AWS MC menu, so I don't want to write any conditional code there.

olfway commented 4 years ago

Sometimes account id embedded in the url, sometimes my password manager inserts it Also, account alias can be changed, so I should have account id saved somewhere

It seems you can parse aws menu like you doing now and then compare account from the menu with account_id and with account_alias.

Do I miss something and this requires something more complicated?

tilfin commented 3 years ago

This can't be supported because both id or alias can't be obtained from the Console page.