Authentication utility class stored on the user's session.
author: Charles Gay author: this class was inspired by the article on jaas published at this address.
authenticate(HttpServletRequest req, HttpServletResponse res, boolean afterRegistration, boolean local) authenticate user and put the corresponding Subject in its session if succeed.
Parameters: req - Parameters: res - Parameters: afterRegistration - :true if user registration was made just before;false otherwise.
authenticate user and put the corresponding Subject in its session if succeed.
Parameters: req - Parameters: res - Parameters: afterRegistration - :true if user registration was made just before;false otherwise. authenticationresult: true if authentication succeed,false otherwise. throws: IOException -