Package com.adito.unixauth

Examples of com.adito.unixauth.UNIXUser


     * @see com.adito.security.UserDatabase#checkPassword(java.lang.String,
     *      java.lang.String, int)
     */
    public boolean checkPassword(String username, String password) throws UserDatabaseException, InvalidLoginCredentialsException {
        // Get the user account
        UNIXUser user = null;
        try {
            user = (UNIXUser) getAccount(username);
        } catch (Exception e) {
            throw new UserDatabaseException("Could not get user account", e);
        }

        // Make sure the user exists
        if (user == null) {
            throw new InvalidLoginCredentialsException();
        }

        // Determine the password type
        String pw = new String(user.getPassword());
        try {
            if (pw.startsWith("$1$")) {
                // MD5
                return pw.substring(12).equals(MD5Crypt.crypt(password, pw.substring(3, 11)).substring(12));
            } else if (pw.startsWith("$2a$")) {
View Full Code Here


                                    continue;
                                }
                            } else {
                                pw = password.toCharArray();
                            }
                            UNIXUser user = new UNIXUser(username, userEmailMap == null ? "" : userEmailMap.getProperty(username,
                                ""), pw, uid, gid, fullname, home, shell, userRoles, this.getRealm());
                            userList.add(user);
                        }
                    }
                } finally {
View Full Code Here

TOP

Related Classes of com.adito.unixauth.UNIXUser

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.