Examples of DisabledException


Examples of org.springframework.security.authentication.DisabledException

        assertEquals(auth, event.getAuthentication());
    }

    public void testAbstractAuthenticationFailureEvent() {
        Authentication auth = getAuthentication();
        AuthenticationException exception = new DisabledException("TEST");
        AbstractAuthenticationFailureEvent event = new AuthenticationFailureDisabledEvent(auth, exception);
        assertEquals(auth, event.getAuthentication());
        assertEquals(exception, event.getException());
    }
View Full Code Here

Examples of org.springframework.security.authentication.DisabledException

        assertEquals(auth, event.getAuthentication());
        assertEquals(exception, event.getException());
    }

    public void testRejectsNullAuthentication() {
        AuthenticationException exception = new DisabledException("TEST");

        try {
            new AuthenticationFailureDisabledEvent(null, exception);
            fail("Should have thrown IllegalArgumentException");
        } catch (IllegalArgumentException expected) {
View Full Code Here

Examples of org.springframework.security.authentication.DisabledException

        switch (code) {
            case PASSWORD_EXPIRED:
                throw new CredentialsExpiredException(messages.getMessage("LdapAuthenticationProvider.credentialsExpired",
                        "User credentials have expired"), cause);
            case ACCOUNT_DISABLED:
                throw new DisabledException(messages.getMessage("LdapAuthenticationProvider.disabled",
                        "User is disabled"), cause);
            case ACCOUNT_EXPIRED:
                throw new AccountExpiredException(messages.getMessage("LdapAuthenticationProvider.expired",
                        "User account has expired"), cause);
            case ACCOUNT_LOCKED:
View Full Code Here

Examples of org.springframework.security.authentication.DisabledException

        if (!user.isAccountNonLocked()) {
            throw new LockedException("User account is locked", user);
        }

        if (!user.isEnabled()) {
            throw new DisabledException("User is disabled", user);
        }

        if (!user.isAccountNonExpired()) {
            throw new AccountExpiredException("User account has expired", user);
        }
View Full Code Here

Examples of org.springframework.security.authentication.DisabledException

        } else {
            user = userDAO.find(username);

            if (user != null) {
                if (user.isSuspended() != null && user.isSuspended()) {
                    throw new DisabledException("User " + user.getUsername() + " is suspended");
                }

                SyncopeConf authStatuses = confDAO.find("authentication.statuses", null);
                if (authStatuses != null) {
                    String[] statuses = authStatuses.getValue().split("\\|");
                    if (!ArrayUtils.contains(statuses, user.getStatus())) {
                        throw new DisabledException("User " + user.getUsername() + " not allowed to authenticate");
                    }
                }

                authenticated = authenticate(
                        authentication.getCredentials().toString(),
View Full Code Here

Examples of org.springframework.security.authentication.DisabledException

        } else {
            user = userDAO.find(username);

            if (user != null && user.isSuspended() != null) {
                if (user.isSuspended()) {
                    throw new DisabledException("User " + user.getUsername() + " is suspended");
                }
                authenticated = authenticate(
                        authentication.getCredentials().toString(),
                        user.getCipherAlgorithm(),
                        user.getPassword());
View Full Code Here

Examples of org.springframework.security.authentication.DisabledException

        } else {
            user = userDAO.find(username);

            if (user != null) {
                if (user.isSuspended() != null && user.isSuspended()) {
                    throw new DisabledException("User " + user.getUsername() + " is suspended");
                }

                SyncopeConf authStatuses = confDAO.find("authentication.statuses", null);
                if (authStatuses != null) {
                    String[] statuses = authStatuses.getValue().split("\\|");
                    if (!ArrayUtils.contains(statuses, user.getStatus())) {
                        throw new DisabledException("User " + user.getUsername() + " not allowed to authenticate");
                    }
                }

                authenticated = authenticate(
                        authentication.getCredentials().toString(),
View Full Code Here

Examples of org.springframework.security.authentication.DisabledException

            authenticated = adminMD5Password.equalsIgnoreCase(passwordUser.getPassword());
        } else {
            user = userDAO.find(username);
            if (user != null && user.isSuspended() != null) {
                if (user.isSuspended()) {
                    throw new DisabledException("User " + user.getUsername() + " is suspended");
                }

                passwordUser.setPassword(authentication.getCredentials().toString(), user.getCipherAlgoritm(), 0);
                authenticated = user.getPassword().equalsIgnoreCase(passwordUser.getPassword());
            }
View Full Code Here

Examples of org.springframework.security.authentication.DisabledException

        } else {
            user = userDAO.find(username);

            if (user != null) {
                if (user.getSuspended()) {
                    throw new DisabledException("User " + user.getUsername() + " is suspended");
                }

                passwordUser.setPassword(authentication.getCredentials().toString(), user.getCipherAlgoritm(), 0);
                authenticated = user.getPassword().equalsIgnoreCase(passwordUser.getPassword());
            }
View Full Code Here

Examples of org.springframework.security.authentication.DisabledException

                throw new LockedException(messages.getMessage("AbstractUserDetailsAuthenticationProvider.locked",
                        "User account is locked"), user);
            }

            if (!user.isEnabled()) {
                throw new DisabledException(messages.getMessage("AbstractUserDetailsAuthenticationProvider.disabled",
                        "User is disabled"), user);
            }

            if (!user.isAccountNonExpired()) {
                throw new AccountExpiredException(messages.getMessage("AbstractUserDetailsAuthenticationProvider.expired",
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.