Package org.apache.shiro.authc

Examples of org.apache.shiro.authc.DisabledAccountException


        if (user == null) {
            throw new IncorrectCredentialsException();
        }
       
        if (user.getState().equals(State.Disable.getValue())) {
           throw new DisabledAccountException("你的账户已被禁用,请联系管理员开通.");
        }
       
        SessionVariable model = new SessionVariable(user);
       
        return new SimpleAuthenticationInfo(model,user.getPassword(),getName());
View Full Code Here


      }

      return this.createAuthenticationInfo(user);
    }
    else if (CUser.STATUS_DISABLED.equals(user.getStatus())) {
      throw new DisabledAccountException("User '" + upToken.getUsername() + "' is disabled.");
    }
    else {
      throw new AccountException("User '" + upToken.getUsername() + "' is in illegal status '"
          + user.getStatus() + "'.");
    }
View Full Code Here

   
    UsernamePasswordToken token = (UsernamePasswordToken)authcToken;
    User user = userService.getByUsername(token.getUsername());
    if (user != null) {
      if (user.getStatus().equals(User.STATUS_DISABLED)) {
        throw new DisabledAccountException();
      }
     
      byte[] salt = Encodes.decodeHex(user.getSalt());
     
      ShiroUser shiroUser = new ShiroUser(user.getId(), user.getUsername());
View Full Code Here

  protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authcToken) throws AuthenticationException {
    UsernamePasswordToken token = (UsernamePasswordToken) authcToken;
    User user = accountService.findUserByLoginName(token.getUsername());
    if (user != null) {
      if ("disabled".equals(user.getStatus())) {
        throw new DisabledAccountException();
      }

      byte[] salt = Encodes.decodeHex(user.getSalt());
      return new SimpleAuthenticationInfo(new ShiroUser(user.getLoginName(), user.getName()), user.getPassword(),
          ByteSource.Util.bytes(salt), getName());
View Full Code Here

TOP

Related Classes of org.apache.shiro.authc.DisabledAccountException

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.