Skip to content

Instantly share code, notes, and snippets.

@sylwit
Created December 1, 2020 16:23
Show Gist options
  • Save sylwit/9dd0a8e5ff419d38d3ade321e454a7a1 to your computer and use it in GitHub Desktop.
Save sylwit/9dd0a8e5ff419d38d3ade321e454a7a1 to your computer and use it in GitHub Desktop.
UserScript - AWS signin SAML - Name AWS account id
// ==UserScript==
// @name AWS signin SAML
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Name AWS account id
// @author sylwit <sylvain.witmeyer@gmail.com>
// @match https://signin.aws.amazon.com/saml
// @grant none
// ==/UserScript==
(function() {
'use strict';
const accounts = {
'011111111111': 'app123',
'022222222222': 'app456',
};
[...document.querySelectorAll('.saml-account-name')].forEach( el => {
const id = el.innerHTML.split(" ").splice(-1);
if (accounts[id]) {
el.innerHTML += ` - ${accounts[id]}`;
};
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment