Package org.springframework.security.authentication

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


        } 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

        } 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

        } 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

            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

        } 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

                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

        User user = userDetailsDao.findByEmail(userName);
        if (user == null) {
            throw new UsernameNotFoundException("User not found for userName: " + userName);
        } else {
            if (!user.isEnabled()) {
                throw new DisabledException("User is disabled");
            }
            userService.setDefaultActiveOrganization(user);
            return user;
        }
    }
View Full Code Here

    if (person == null) {
      throw new UsernameNotFoundException("User not found for: " + token.getPrincipal());
    }
   
    if (!person.isActive()) {
      throw new DisabledException("User is disabled");
    }
   
    Set<GrantedAuthority> grantedAuthorities = new HashSet<GrantedAuthority>();
   
    addAuthorities(grantedAuthorities, person.getAuthorities());
View Full Code Here

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

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

                CAttr authStatuses = confDAO.find("authentication.statuses");
                if (authStatuses != null && !authStatuses.getValuesAsStrings().contains(user.getStatus())) {
                    throw new DisabledException("User " + user.getUsername() + " not allowed to authenticate");
                }

                authenticated = authenticate(user, authentication.getCredentials().toString());

                updateLoginAttributes(user, authenticated);
View Full Code Here

TOP

Related Classes of org.springframework.security.authentication.DisabledException

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.