Skip to content

Instantly share code, notes, and snippets.

@hawkrives
Last active September 24, 2024 21:36
Show Gist options
  • Save hawkrives/ebb1ebc6b3303c6d59c1cd3a00b3476a to your computer and use it in GitHub Desktop.
Save hawkrives/ebb1ebc6b3303c6d59c1cd3a00b3476a to your computer and use it in GitHub Desktop.
Automated AWS SSO CLI - Login
// ==UserScript==
// @name Automated AWS SSO CLI - Login
// @namespace http://glencoakley.org
// @match https://*.awsapps.com/start/user-consent/authorize.html?clientId=*
// @grant none
// @version 1.0
// @author Glen Coakley
// @description Automatically presses the "Sign in to AWS CLI" button. Inspired by Nicholas Hawkes' "Auto AWS SSO CLI - Login" at https://gist.github.com/hawkesnc/ae9fc22fc5d17ac250f6376b0591161c
// @homepage https://gist.github.com/GlenCoakley/d3a82a41b2e578b29875625ec6ffa11e
// ==/UserScript==
function click_it() {
let login = document.querySelector('#cli_login_button');
if (login) {
login.click();
} else {
setTimeout(click_it, 500);
}
}
window.onload = () => setTimeout(click_it, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment