How to get current user name via javascript


#1

My goal is through click one URL to send the user name to other web application,
like http://OTHER_WEB_APPLICATION_IP:8080/PROJUCT_NAME/XXX?username=xxx
This URL link can be on anywhere, example on tasklist page.

If in Camunda I can use some JAVA code to get it, just like identityService.getCurrentAuthentication().getUserId();
But how can I get it via javascript when user has login Camunda?
Is there have a user variable save in session or cookie? I’m not sure.