Skip to content

Instantly share code, notes, and snippets.

@lukethacoder
Created December 22, 2022 09:49
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 lukethacoder/56db67e6d9dbd53b502e74680bb4ae3f to your computer and use it in GitHub Desktop.
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)
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