Created
October 17, 2023 11:29
-
-
Save tedkulp/01f57768de9111ffa5675587ca98e1b0 to your computer and use it in GitHub Desktop.
Tampermonkey script to skip AWS SSO login process
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
// ==UserScript== | |
// @name Auto AWS SSO Login | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://*.awsapps.com/start/user-consent/authorize.html* | |
// @match https://*.awsapps.com/start/user-consent/login-success.html | |
// @match https://device.sso.us-east-1.amazonaws.com/?user_code=* | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant window.close | |
// @grant GM_log | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const verificationBtn = document.querySelector('#cli_verification_btn'); | |
if (verificationBtn) { | |
verificationBtn.click(); | |
return; | |
} | |
const loginBtn = document.querySelector('#cli_login_button'); | |
if (loginBtn) { | |
loginBtn.click(); | |
return; | |
} | |
const statusSelector = document.querySelector('.awsui-util-mb-s') | |
if (statusSelector) { | |
if (statusSelector.innerHTML.indexOf('approved') >= 0) { | |
window.close(); | |
return; | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment