How to Switch Roles Quickly with SSO Login?

0
16
Asked By CuriousCat83 On

I'm looking for tips on how to quickly assume roles after logging in through SSO. I was using the assume/granted method, but it suddenly stopped working. I received an error saying my session token was not found or was invalid. Any suggestions on how to resolve this?

4 Answers

Answered By MacMaster44 On

I've experienced the same error on macOS. Try removing your local AWS cache folder located at ~/.aws/sso/cache and also check your keychain for granted, then delete the SSO token. That worked for me!

Answered By DocFinder77 On

Check out these resources for some guidance:
- [Oh My Zsh AWS Plugin](https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/aws/README.md)
- [AWS CLI SSO Configuration Docs](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html)
- [AWS SSO Util GitHub](https://github.com/benkehoe/aws-sso-util)

Answered By CloudDude22 On

Just a heads up, remember that tokens have a limited lifetime. It's possible the maximum lifetime value was changed, which could cause your issue.

Answered By TechGuru99 On

One way to switch roles easily is by using profiles. Log in with your default profile and then swap to other roles using config profiles. Some of my teammates prefer using environment variables to set profiles, while others use the --profile option. Keeping the config in Git makes it easy to stay updated with new accounts!

RoleWatcher42 -

So do you need to set up a profile first to assume another role?

SmartCookie21 -

If you're going the environment variable route, don't forget to include your current profile in your prompt to make it easier to remember!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.