Ok, here I got more information by looking in Zimbra's sources:
The login is performed in Zimbra in com.zimbra.cs.taglib.tag.LoginTag (the ZimbraTagLib project). The WebRoot/public/login.jsp page is where the actual login tag is used (this page is for both displaying the login page and processing the user's username+password).
However it doesn't seem that this page is placing this data anywhere accessible (like in session or smt).
Nevertheless, I fixed half part of the problem: got the username, using the following JavaScript code:
Code:
appCtxt.get(ZmSetting.USERNAME)
This will provide the username. Now I only need to find the password of the user.