Examples of AccountException


Examples of org.apache.shiro.authc.AccountException

  protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) {
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    if (user == null){
      throw new AccountException("Not authenticated.");
    }
   
    return new SimpleAuthenticationInfo(user, null, getName());
  }
View Full Code Here

Examples of org.apache.shiro.authc.AccountException

    // if the user can authenticate we are good to go
    if (authenticateViaUrl(upToken)) {
      return buildAuthenticationInfo(upToken);
    }
    else {
      throw new AccountException("User \"" + upToken.getUsername()
          + "\" cannot be authenticated via Kenai Realm.");
    }
  }
View Full Code Here

Examples of org.apache.shiro.authc.AccountException

    CUser user;
    try {
      user = configuration.readUser(upToken.getUsername());
    }
    catch (UserNotFoundException e) {
      throw new AccountException("User '" + upToken.getUsername() + "' cannot be retrieved.", e);
    }

    if (user.getPassword() == null) {
      throw new AccountException("User '" + upToken.getUsername() + "' has no password, cannot authenticate.");
    }

    if (CUser.STATUS_ACTIVE.equals(user.getStatus())) {
      //Check for legacy user that has unsalted password hash
      //Update if legacy user, and valid credentials were specified
      if (this.isLegacyUser(user) && this.isValidCredentials(upToken, user)) {
        this.reHashPassword(user, new String(upToken.getPassword()));
      }

      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

Examples of org.apache.shiro.authc.AccountException

    UsernamePasswordToken upToken = (UsernamePasswordToken) token;
    String username = upToken.getUsername();

    // Null username is invalid
    if (username == null) {
        throw new AccountException("Null usernames are not allowed by this realm.");
    }
    String password = jsonDbService.getPassword(username);

    return  new SimpleAuthenticationInfo(username, password, this.getName());
  }
View Full Code Here

Examples of org.apache.shiro.authc.AccountException

      }
       
        String username = token.getUsername();

        if (username == null) {
            throw new AccountException("Null usernames are not allowed by this realm.");
        }

        Connection conn = null;
        AuthenticationInfo info = null;
        try {
View Full Code Here

Examples of org.jsecurity.authc.AccountException

    UsernamePasswordToken upToken = (UsernamePasswordToken) token;
    String username = upToken.getUsername();

    // Null username is invalid
    if (username == null) {
        throw new AccountException("Null usernames are not allowed by this realm.");
    }
    String password = jsonDbService.getPassword(username);

    return  new SimpleAuthenticationInfo(username, password, this.getName());
  }
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.