Skip to content

Instantly share code, notes, and snippets.

@kkoziarski
Created March 16, 2020 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkoziarski/31544cfb03fd5a5eb526fa691c1dd3d0 to your computer and use it in GitHub Desktop.
Save kkoziarski/31544cfb03fd5a5eb526fa691c1dd3d0 to your computer and use it in GitHub Desktop.
copy JWT token bookmarklet (jwt-cp)
javascript: (function() {
var key = window.localStorage.getItem('adal.token.keys').split('|')[0];
var token = window.localStorage.getItem('adal.access.token.key' + key);
if (token) {
/*window.prompt("Copy to clipboard: Ctrl+C, Enter", token);*/
sendToClipbord(token);
}
function sendToClipbord(myString) {
var textarea = document.createElement('textarea');
document.body.appendChild(textarea);
textarea.value = myString;
textarea.style.position = 'fixed';
textarea.focus();
textarea.select();
document.execCommand('Copy');
textarea.remove();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment