Log in a user with username and password.
@param username The username.
@param password The password.
@param subject An optional Subject to receive principals and credentials for the logged in user.If provided, it will be returned as the return value; if not, a new Subject will be returned.
@return A Subject representing the logged in user.
@throws LoginException
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.