Package com.adito.security.forms

Examples of com.adito.security.forms.PromptForSessionPasswordForm


     * @return forward
     * @throws Exception
     */
    public ActionForward commit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        PromptForSessionPasswordForm pfspf = (PromptForSessionPasswordForm) form;
        AuthenticationScheme scheme = (AuthenticationScheme) getSessionInfo(request).getHttpSession().getAttribute(Constants.AUTH_SESSION);
        try {
            SessionInfo session = getSessionInfo(request);
            UserDatabase udb = UserDatabaseManager.getInstance().getUserDatabase(session.getUser().getRealm());
            String username = session.getUser().getPrincipalName();
            if (!udb.checkPassword(username, pfspf.getPassword())) {
                throw new Exception("Incorrect password.");
            }
            scheme.addCredentials(new PasswordCredentials(username, pfspf.getPassword().toCharArray()));
            request.setAttribute(Constants.REQ_ATTR_FORWARD_TO, ((PromptForSessionPasswordForm)form).getForwardTo());
            request.setAttribute(Constants.REQ_ATTR_TARGET, ((PromptForSessionPasswordForm)form).getTarget());
            request.setAttribute(Constants.REQ_ATTR_FOLDER, ((PromptForSessionPasswordForm)form).getFolder());
            return mapping.findForward("redirect");
        } catch (InvalidLoginCredentialsException e) {
View Full Code Here

TOP

Related Classes of com.adito.security.forms.PromptForSessionPasswordForm

Copyright © 2018 www.massapicom. All rights reserved.
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.