-
Notifications
You must be signed in to change notification settings - Fork 820
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
Feature: Automatically logout before login #721
Comments
Came here to open the same issue 😁 I noticed that SSO console links for "Management Console" do not require logout. Clicking any of the links in SSO logs you in right away. While when Links point to:
Management ConsoleThis works automatically. Manual Logout |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This annoys me quite a lot as well. aws-vault() {
if [[ $@ = login* ]]; then
echo "logging out first"
command xdg-open https://eu-west-2.console.aws.amazon.com/cloudformation/logout\!doLogout
command aws-vault "$@"
else
command aws-vault "$@"
fi
}
Hope that helps you @tm-lmathieu & @moltar 😁 |
I also found a solution, I should have posted it here a good while ago. Here's my bash alias:
It launches a new window of my default browser on the logout URL, waits for one second, uses wmcrtl to close the active window, then runs the login command with my Yubikey for the 2FA. |
I found a way to log out and redirect to the federated login link using # modify the federated login link to use the us-east-1 endpoint
url=$(aws-vault login "${account}" -s | sed 's#://#://us-east-1.#')
# urlencode the federated link because it will be embedded as a query parameter
encoded_url=$(printf "%s" "$url" | python -c 'import sys; from urllib.parse import quote_plus; print(quote_plus(sys.stdin.read().strip()))')
# use the oauth URL with Action=logout and a redirect_uri set to the federated link
open "https://signin.aws.amazon.com/oauth?Action=logout&redirect_uri=${encoded_url}" I could only get this to work if the federated link is modified to use the us-east-1 endpoint. Didn't find documentation on why this trick works. |
Using
aws-vault login
while already logged in opens a window that tells you to log out. Could there be a way to logout automatically?The text was updated successfully, but these errors were encountered: