Created
December 22, 2022 09:49
-
-
Save lukethacoder/56db67e6d9dbd53b502e74680bb4ae3f to your computer and use it in GitHub Desktop.
APEX: Print the `UserInfo.getSessionId()` to the developer console without it being obfuscated. (Salesforce Apex)
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
String theToken = ''; | |
for (String idPart : UserInfo.getSessionId().split('')) { | |
theToken += '"' + idPart + '",'; | |
} | |
System.debug('[ ' + theToken + '].join(\'\')'); | |
// DEBUG: [ "0", "1", "2", ...].join('') | |
// the output can be pasted into a browser console to join it back into a single string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment