Examples of LoginException


Examples of org.apache.tapestry.vlib.ejb.LoginException

        {
            person = home.findByEmail(email);
        }
        catch (FinderException ex)
        {
            throw new LoginException("Unknown e-mail address.", false);
        }

        if (!person.getPassword().equals(password))
            throw new LoginException("Invalid password.", true);

        try
        {
            result = getPerson((Integer) person.getPrimaryKey());
        }
        catch (FinderException ex)
        {
            throw new LoginException("Could not read person.", false);
        }

        if (result.isLockedOut())
            throw new LoginException("You have been locked out of the Virtual Library.", false);

        // Set the last access time for any subsequent login.

        person.setLastAccess(new Timestamp(System.currentTimeMillis()));
View Full Code Here

Examples of org.apache.wicket.security.authentication.LoginException

      }
      else
        subject.addPrincipal(new MyPrincipal("basic"));
      return subject;
    }
    throw new LoginException("Username and password do not match any known user.");
  }
View Full Code Here

Examples of org.damour.base.client.exceptions.LoginException

      } else if (cookies[i].getName().equals("auth") && !cookies[i].getValue().equals("")) {
        userAuthCookie = cookies[i];
      }
    }
    if (userCookie == null || userAuthCookie == null) {
      throw new LoginException("Could not get authenticated user.");
    }
    User user = getAuthenticatedUser(session.get());
    if (user == null) {
      destroyAuthCookies(getThreadLocalRequest(), getThreadLocalResponse());
      throw new LoginException("Could not get authenticated user.");
    }
    return user;
  }
View Full Code Here

Examples of org.rhq.enterprise.server.exception.LoginException

        return _login(username, password, true, false);
    }
   
    private Subject _login(String username, String password, boolean checkRoles, boolean remote) throws LoginException {
        if (password == null) {
            throw new LoginException("No password was given");
        }

        // Use the JAAS modules to perform the auth.
        _checkAuthentication(username, password);

        // User is authenticated!

        Subject subject = getSubjectByName(username);

        if (subject != null) {//regular JDBC user
            if (!subject.getFactive()) {
                throw new LoginException("User account has been disabled.");
            }

            if (checkRoles) {
                // fetch the roles
                int rolesNumber = subject.getRoles().size();
                if (rolesNumber == 0) {
                    if (systemManager.isLoginWithoutRolesEnabled()) {
                        if (log.isInfoEnabled()) {
                            log.info("Letting in user [" + subject.getName() + "]  without any assigned roles.");
                        }
                    } else {
                        throw new LoginException("There are no preconfigured roles for user [" + subject.getName()
                            + "]");
                    }
                }
            }
        } else {
View Full Code Here

Examples of org.serviceconnector.web.LoginException

    String contextPassword = WebContext.getWebSCContextCredentials().getPassword();
    if (contextUserid == null || contextPassword == null) {
      throw new InvalidConfigurationException("system configuration has no credentials");
    }
    if (userid == null || password == null) {
      throw new LoginException("not authorized");
    }
    if (userid.equals(contextUserid) == false) {
      throw new LoginException("not authorized");
    }
    if (password.equals(contextPassword) == false) {
      throw new LoginException("not authorized");
    }
    WebSession webSession = request.getSession(true);
    if (webSession == null) {
      // check if has been created before
      throw new LoginException("internal error, no session");
    }
    webSession.setCredentials(new WebCredentials(contextUserid, contextPassword));
    webSession.setUserAgent(request.getHeader("User-Agent"));
    webSession.setRemoteHost(request.getRemoteHost());
    webSession.setRemotePort(request.getRemotePort());
View Full Code Here

Examples of org.wicketstuff.security.authentication.LoginException

   * @see LoginContext#login()
   */
  public void login(LoginContext context) throws LoginException
  {
    if (preventsLogin != null)
      throw new LoginException("Additional Logins are not allowed");
    if (context == null)
      throw new LoginException("Context is required to login.");
    HashKey key = new HashKey(context);
    if (subjects.containsKey(key))
      throw new LoginException("Already logged in through this context ").setLoginContext(context);
    Subject mySubject;
    mySubject = context.login();
    if (mySubject == null)
      throw new LoginException("Login failed ").setLoginContext(context);
    mySubject.setReadOnly();
    if (key.preventsAdditionalLogins())
      preventsLogin = key;
    subjects.put(key, mySubject);
    logins.add(key);
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.