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

Adfs cookie reusage issue during username change #178

Open
emanuelr93 opened this issue Oct 30, 2020 · 4 comments
Open

Adfs cookie reusage issue during username change #178

emanuelr93 opened this issue Oct 30, 2020 · 4 comments

Comments

@emanuelr93
Copy link

If is used login via Environment variable, if I try to change username the adfs_cookies of old account is used.

export username=test
export password=test
aws-adfs login --adfs-host=your-adfs-hostname --role-arn=my-role-arn --env

With this commad, the old adfs_cookie is reused and authentication fail.

export username=test1
export password=test1
aws-adfs login --adfs-host=your-adfs-hostname --role-arn=my-role-arn --env

The only way to resolve this issue is to remove adfs_cookies file inside .aws directory

@adrianolettieri
Copy link

I had the same problem and what @emanuelr93 is suggesting fixed it.
In my case it was even harder to identify the issue because when the account has only one arn-role associated you don't get any error, you just receive the key for the wrong account.

@pdecat
Copy link
Collaborator

pdecat commented Dec 4, 2020

Appending the ADFS hostname and the username to the adfs_cookies filename may help prevent this issue.

@emanuelr93
Copy link
Author

emanuelr93 commented Dec 4, 2020

Yes, but please take care about special characters. For example the username can container / for domain or somethings similar. Another issue is related to the account that has only one arn-role association (as @adrianolettieri report). In this case, if you have only one arn-role, aws-adfs completely ignores the one passed by the user even if it is wrong. A strict check should be included in order not to mislead.

@pdecat
Copy link
Collaborator

pdecat commented Dec 5, 2020

Yes, but please take care about special characters. For example the username can container / for domain or somethings similar.

Indeed. Using a hash of those is probably better.

@pdecat pdecat self-assigned this Sep 22, 2021
@pdecat pdecat removed their assignment Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants