Last active
February 7, 2018 06:39
-
-
Save justinm/344004899868e86b1e9c9a1d66af02d8 to your computer and use it in GitHub Desktop.
Script to support multi-terminal authentication with okta-awscli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
CREDENTIALS_CACHE="$HOME/.okta-credentials.cache" | |
if [ ! -f $CREDENTIALS_CACHE ] || test `find "$CREDENTIALS_CACHE" -mmin +120` | |
then | |
okta-awscli --cache | |
# If okta-awscli exits with a non-zero status code, the next line will not run | |
source $CREDENTIALS_CACHE | |
else | |
source $CREDENTIALS_CACHE | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment