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

Support SAML assertion caching for multiple profiles #245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jlsalmon
Copy link

Currently the SAML assertion cache only works for a single profile. This
is because the logic only caters for a single cache file.

This PR allows response caching for multiple profiles, e.g.:

$ aws-google-auth --profile profile-a --keyring
Please visit the following URL to view your CAPTCHA: https://...
Captcha (case insensitive): ...
MFA token: ...
Assuming arn:aws:iam::111111111111:role/my-role
Credentials Expiration: 2022-03-29 22:43:51+11:00

$ aws-google-auth --profile profile-b --keyring
Please visit the following URL to view your CAPTCHA: https://...
Captcha (case insensitive): ...
MFA token: ...
Assuming arn:aws:iam::222222222222:role/my-role
Credentials Expiration: 2022-03-29 22:44:22+11:00

$ aws-google-auth --profile profile-a --keyring
Assuming arn:aws:iam::111111111111:role/my-role
Credentials Expiration: 2022-03-29 22:44:25+11:00

$ aws-google-auth --profile profile-b --keyring
Assuming arn:aws:iam::222222222222:role/my-role
Credentials Expiration: 2022-03-29 22:45:32+11:00

Currently the SAML assertion cache only works for a single profile. This
is because the logic only caters for a single cache file.

This PR allows response caching for multiple profiles, e.g.:

```
$ aws-google-auth --profile profile-a --keyring
Please visit the following URL to view your CAPTCHA: https://...
Captcha (case insensitive): ...
MFA token: ...
Assuming arn:aws:iam::111111111111:role/my-role
Credentials Expiration: 2022-03-29 22:43:51+11:00

$ aws-google-auth --profile profile-b --keyring
Please visit the following URL to view your CAPTCHA: https://...
Captcha (case insensitive): ...
MFA token: ...
Assuming arn:aws:iam::222222222222:role/my-role
Credentials Expiration: 2022-03-29 22:44:22+11:00

$ aws-google-auth --profile profile-a --keyring
Assuming arn:aws:iam::111111111111:role/my-role
Credentials Expiration: 2022-03-29 22:44:25+11:00

$ aws-google-auth --profile profile-b --keyring
Assuming arn:aws:iam::222222222222:role/my-role
Credentials Expiration: 2022-03-29 22:45:32+11:00
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant