When logged into the AWS web console it can be helpful to quickly see details of your current identity. This can include:
- An ARN
- Your current account alias
- Issuer info, indicating tools such as aws-vault
- Your username, which may include a role session name
This bookmarklet is a simple way to parse that information out of the aws-userInfo
cookie and return it as pretty printed JSON.
To use this:
- Create a new bookmark in your browser, and paste this in as the location:
javascript:(function () {
function fullDecode (input) {
let decoded = decodeURIComponent(input);
return (decoded == input ? decoded : fullDecode(decoded))
};
let userInfo = document.cookie.replace(/(?:(?:^|.*;\s*)aws-userInfo\s*\=\s*([^;]*).*$)|^.*$/, "$1");
alert(JSON.stringify(JSON.parse(fullDecode(userInfo)), null, 4))
})();
- Click the bookmark while logged into the AWS web console