Created
August 1, 2018 19:09
-
-
Save AlainODea/9fd46ef07e254283f0277c1bdb827dd8 to your computer and use it in GitHub Desktop.
Local web page that can decode URL-encoded Base64-encoded content (like SAMLResponse)
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>URL Encoded Base 64 Decoder</title> | |
<script type="text/javascript"> | |
function decode() { | |
var urlDecoded = decodeURIComponent(document.getElementById('urlencoded-base64-input').value); | |
var base64Decoded = atob(urlDecoded); | |
var encodedStr = base64Decoded.replace(/[\u00A0-\u9999<>\&]/gim, function(i) { | |
return '&#' + i.charCodeAt(0) + ';'; | |
}); | |
var result = encodedStr; | |
document.getElementById('plain-output').innerHTML = result; | |
} | |
</script> | |
</head> | |
<body> | |
<div> | |
<textarea rows="10" cols="50" id="urlencoded-base64-input"></textarea> | |
</div> | |
<div> | |
<input type="button" onclick="decode()" value="Decode" /> | |
</div> | |
<div> | |
<textarea rows="80" cols="80" id="plain-output"></textarea> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment