How to get login password in servlets
- by Dusk
I've successfully implemented form based authentication, and now I want to get the username and password to initialize session object in javamail from servlets. How can I do that? I can getlogin username by using method request.getRemoteUser(), but I don't know how to get the password.
If I create any session object like:
authentication = new PasswordAuthentication(user,password);
Properties props = new Properties();
props.put("mail.host", "localhost");
props.put("mail.debug",true);
props.put("mail.store.protocol", "pop3");
props.put("mail.transport.protocol", "smtp");
Session session = Session.getInstance(props, this);
then how can I get inbox messages from mail server based upon particular username and password, if I don't pass any password from servlets to PasswordAuthentication object?