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

AssumeRoleWithSAML operation: Principal ARN is invalid #163

Open
kirankraleti opened this issue Feb 13, 2020 · 6 comments · May be fixed by #230
Open

AssumeRoleWithSAML operation: Principal ARN is invalid #163

kirankraleti opened this issue Feb 13, 2020 · 6 comments · May be fixed by #230

Comments

@kirankraleti
Copy link

While selecting a role and hitting enter, below error shows up. Any fix?

Type the number (1 - 2) of the role to assume: 2
image

@manzke
Copy link

manzke commented Mar 14, 2020

Hey I can help here. I had the same problem. The issue is the order you have entered the information in the google user profile.
Google and AWS don't care, but this command line does. ;)

Doesn't work ,
arn:aws:iam::xxxx:saml-provider/Google,arn:aws:iam::xxx:role/sso-sysadmin

works ,
arn:aws:iam::xxx:role/sso-sysadmin,arn:aws:iam::xxxx:saml-provider/Google

@manzke
Copy link

manzke commented Mar 14, 2020

issue is here: https://github.com/cevoaustralia/aws-google-auth/blob/master/aws_google_auth/amazon.py#L83

parsing for iam is not enough. it has to check for saml-provider

@demon
Copy link

demon commented Apr 3, 2020

There's actually another reason this can fail -- a space after the comma. I had configured <role_arn>, <provider_arn>.

A simple trim() on the values would avoid this.

@stevemac007
Copy link
Contributor

If you have a sample SAML response that we can write a test against to validate this, I'd be happy to included it in the codebase.

I'm trying to increase the test coverage with real(ish) world examples to increase the resilience.

@stibi
Copy link

stibi commented Nov 1, 2020

@demon is right, I have just seen the problem because of a comma. strip() FTW.

@mgab mgab linked a pull request May 13, 2021 that will close this issue
@mgab
Copy link

mgab commented May 19, 2021

Quite annoying issue, specially in large organizations where one does not have direct access to the google profile configuration...

I created a PR to try to fix this. Happy to discuss changes 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants