Getting user authentication data in zimlet JSP
Hello,
I am using Zimbra 5.0.8 and I want to integrate it with an existing system that requires authentication before allowing access to the services that it provides. Therefore when I make a request in a zimlet's JSP file, I need the username and the password of the currently authenticated user.
I have configured the external system to have the same authentication data as Zimbra, and therefore all the accounts configured in Zimbra also exist and can be used in the external system.
Now the problem is that when I make the request from the Zimlet JSP I need the current user's authentication data (username+password). How can I get this data?
I mention that I read the zimlet whitedraft and the zimlet developer wiki pages. I also investigated the session that is available in the JSP, but to no avail.
Thank you in advance for any answer that I will receive.
Bogdan
Password is not available...nor should it be
I am getting the user's account name with the following method:
var userId = appCtxt.getActiveAccount().getEmail();
As sam_gennux explains above, the password is not available. You do not want the password exposed in the client javascript code.
We are dealing with the same issue. Somehow, we need to authenticate with another system to perform a single sign-on operation. It does not look like this is something that we will be able to accomplish safely from the zimlet itself, without creating a security hole. If you have not figured out a solution within a week or two, feel free to e-mail me, and I will let you know if we were able to get our solution working.
jadams at q90 dot com.