broamski / aws-mfa

Manage AWS MFA Security Credentials
MIT License
1.01k stars 163 forks source link

Token expiry is too low #64

Open gauravarora opened 3 years ago

gauravarora commented 3 years ago

The token should be generated for 36 hours but it is instead generated for an hour. I'm in the IST timezone. This has worked flawlessly in the past. Is there a setting that I'm missing?

❯ date
Tue May  4 10:40:53 IST 2021
❯ date -u
Tue May  4 05:10:55 UTC 2021
❯ aws-mfa --force --duration 129600
INFO - Validating credentials for profile: default
INFO - Forcing refresh of credentials.
Enter AWS MFA code for device [arn:aws:iam::xxxx:mfa/xxxx] (renewing for 129600 seconds):119525
INFO - Fetching Credentials - Profile: default, Duration: 129600
INFO - Success! Your credentials will expire in 129600 seconds at: 2021-05-04 06:11:33+00:00
❯ date
Tue May  4 10:41:09 IST 2021
❯ date -u
Tue May  4 05:11:11 UTC 2021
ezheidtmann commented 3 years ago

Are you using assume_role method? Roles have a maximum session duration configured on AWS, which defaults to 1 hour. You can increase to 12 hours.

gauravarora commented 3 years ago

No assume_role in my config anywhere.