Package com.adito.security

Examples of com.adito.security.UserDatabase.checkPassword()


    public ActionForward commit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
                    throws Exception {
        PromptForPrivateKeyPassphraseForm f = (PromptForPrivateKeyPassphraseForm) form;
        SessionInfo session = getSessionInfo(request);
        UserDatabase udb = UserDatabaseManager.getInstance().getUserDatabase(session.getUser().getRealm());
        if(!udb.checkPassword(session.getUser().getPrincipalName(),
            f.getPassphrase())) {
          // User has entered incorrect passphrase - go back
          ActionErrors errs = new ActionErrors();
            errs.add(Globals.ERROR_KEY, new ActionMessage("promptForPrivateKeyPassphrase.error.incorrectPassphrase"));
            saveErrors(request.getSession(), errs);
View Full Code Here


        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());
View Full Code Here

                throw new FieldValidationException("newAndConfirmPasswordsDontMatch");
            }
            if (getNewPassword().length() == 0) {
                throw new FieldValidationException("noNewPassword");
            }
            if (!udb.checkPassword(user.getPrincipalName(), getOldPassword())) {
                throw new FieldValidationException("oldPasswordIncorrect");
            } else {
                // Check that the password matches the current policy, if not
                // then request a new one
                try {
View Full Code Here

            String username = realmName == null ? realmAndUsername : getAfter(realmAndUsername, "/");
            String password = getAfter(credentials, ":");

            try {
                UserDatabase userDatabase = getUserDatabase(realmName);
                if (userDatabase.checkPassword(username, password)) {
                    return userDatabase.getAccount(username);
                }
            } catch (InvalidLoginCredentialsException e) {
                logger.info("Authentication failed for user " + username);
            } catch (Exception e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.