Skip to content

Instantly share code, notes, and snippets.

@jaklan
Last active March 6, 2025 19:02
Show Gist options
  • Save jaklan/7d41d7c7c46c755eda24aa8449f218a8 to your computer and use it in GitHub Desktop.
Save jaklan/7d41d7c7c46c755eda24aa8449f218a8 to your computer and use it in GitHub Desktop.
[Tampermonkey] Confirm login in AWS IAM Identity Center
// ==UserScript==
// @name AWS IAM Identity Center
// @namespace http://tampermonkey.net/
// @version 1.0
// @author Jakub Lanski
// @description Confirm login in AWS IAM Identity Center.
// @icon https://www.google.com/s2/favicons?sz=64&domain=aws.amazon.com
// @match https://*.awsapps.com/start/*
// @require https://gist.github.com/jaklan/2fb5d31797e0dc320d1450119e14f463/raw
// ==/UserScript==
"use strict";
(async function () {
const acceptButtonId = '[data-analytics="accept-user-code"]';
const acceptButton = await waitForElement(acceptButtonId);
acceptButton.click();
const allowButtonId = '[data-analytics="consent-allow-access"]';
const allowButton = await waitForElement(allowButtonId);
allowButton.click();
const successAlertId =
'[data-analytics="consent-success-device-code-no-scope"]';
await waitForElement(successAlertId);
window.close();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment