ruimarinho / gsts

Obtain and store AWS STS credentials to interact with Amazon services by authenticating via G Suite SAML.
MIT License
212 stars 37 forks source link

role-arn argument is not respected when existing session exists #16

Closed wryun closed 4 years ago

wryun commented 4 years ago

When I want to change who I am, gsts is very keen to tell me that there's an existing session:

; gsts --aws-role-arn arn:aws:sts::426442959523:role/...
Skipping re-authorization as session is valid until Sat Apr 25 2020 04:54:45 GMT+1000 (Australian Eastern Standard Time). Use --force to ignore.

It would be nice if --force wasn't required in this situation (i.e. that it recognised that this wasn't the current role).

ruimarinho commented 4 years ago

Makes sense! Implemented on https://github.com/ruimarinho/gsts/releases/tag/v2.3.0-beta.2.

The first run will write the Role ARN to the credentials file, but subsequent runs with different roles should be detected from now on.