Examples of Login


Examples of com.caucho.security.Login

    if (auth == null)
      throw new ServletException(L.l("No authentication mechanism is configured for '{0}'", getWebApp()));

    // server/1aj0
    Login login = webApp.getLogin();

    if (login == null)
      throw new ServletException(L.l("No login mechanism is configured for '{0}'", getWebApp()));

    if (! login.isPasswordBased())
      throw new ServletException(L.l("Authentication mechanism '{0}' does not support password authentication", login));

    removeAttribute(Login.LOGIN_USER_NAME);
    removeAttribute(Login.LOGIN_USER_PRINCIPAL);
    removeAttribute(Login.LOGIN_PASSWORD);

    Principal principal = login.getUserPrincipal(this);

    if (principal != null)
      throw new ServletException(L.l("UserPrincipal object has already been established"));

    setAttribute(Login.LOGIN_USER_NAME, username);
    setAttribute(Login.LOGIN_PASSWORD, password);

    try {
      login.login(this, getResponse(), false);
    }
    finally {
      removeAttribute(Login.LOGIN_USER_NAME);
      removeAttribute(Login.LOGIN_PASSWORD);
    }

    principal = login.getUserPrincipal(this);

    if (principal == null)
      throw new ServletException("can't authenticate a user");
  }
View Full Code Here

Examples of com.caucho.security.Login

        return false;
      }

      // If the authenticator can find the user, return it.
      Login login = webApp.getLogin();

      if (login != null) {
        Principal user = login.login(this, getResponse(), isFail);

        if (user != null) {
          setAttribute(Login.LOGIN_USER_PRINCIPAL, user);
         
          return true;
View Full Code Here

Examples of com.caucho.security.Login

    Authenticator auth = webApp.getConfiguredAuthenticator();

    if (auth == null)
      throw new ServletException(L.l("No authentication mechanism is configured for '{0}'", getWebApp()));

    Login login = webApp.getLogin();

    if (login == null)
      throw new ServletException(L.l("No authentication mechanism is configured for '{0}'", getWebApp()));

    Principal principal = login.login(this, response, true);

    if (principal != null) {
      setAttribute(Login.LOGIN_USER_PRINCIPAL, principal);
   
      return true;
View Full Code Here

Examples of com.caucho.security.Login

    WebApp webApp = getWebApp();
    if (webApp == null)
      return null;

    // If the authenticator can find the user, return it.
    Login login = webApp.getLogin();

    if (login != null) {
      user = login.getUserPrincipal(this);

      if (user != null) {
        getResponse().setPrivateCache(true);
      }
      else {
View Full Code Here

Examples of com.caucho.security.Login

        return result;
      }
    }

    Login login = webApp == null ? null : webApp.getLogin();

    boolean inRole = login != null && login.isUserInRole(user, role);

    if (log.isLoggable(Level.FINE)) {
      if (login == null)
        log.fine(this + " no Login for isUserInRole");
      else if (user == null)
View Full Code Here

Examples of com.centraview.login.Login

    HashMap hm = null;
    getPATH();
    try {
      InitialContext ic = CVUtility.getInitialContext();
      LoginHome lh = (LoginHome) ic.lookup("Login");
      Login remote = (Login) lh.create();
      remote.setDataSource(dataSource);
      hm = (HashMap) remote.authenticateUser(userName, passwd);
      //checking hashmap
      if (hm != null && hm.get("userid")!= null && hm.get("individualid")!= null && hm.get("lastName")!= null && hm.get("firstName")!= null ) {
        session.set("authenticateUserHashMap", hm);
        authenticationString = AUTHENTICATION_SUCCESS_STATUS;
        //QBSyncHome qbsh = (QBSyncHome) CVUtility.getHomeObject("com.centraview.qbsync.QBSyncHome", "QBSync");
View Full Code Here

Examples of com.centraview.login.Login

      if (lh == null) {
        return (mapping.findForward("dataerror"));
      }

      Login remote = lh.create();
      remote.setDataSource(dataSource);
      usrResult = remote.authenticateUser(username, password);
      // Check to make sure the usrResult has all the fields we expect of it.
      // if so then it was a valid login, if not, then we will fail with a general
      // authentication error.
      if (usrResult.containsKey("individualid") && usrResult.containsKey("firstName") && usrResult.containsKey("lastName") && usrResult.containsKey("type")) {
        int individualId = Integer.parseInt((String)usrResult.get("individualid"));
        userType = (String)usrResult.get("type");
        String firstName = (String)usrResult.get("firstName");
        String lastName = (String)usrResult.get("lastName");

        if ((! userType.equalsIgnoreCase((String)daf.get("userType"))) && ! ("EMPLOYEE".equals(daf.get("userType")) && userType.equalsIgnoreCase("ADMINISTRATOR"))) {
          String errorHeader = "Error occurred during login.";
          errorMap.put(new Integer(0), errorHeader);
          String error = "The username or password was incorrect, or the user is disabled.";
          errorMap.put(new Integer(1), error);
          request.setAttribute("error", errorMap);
          FORWARD_final = GLOBAL_FORWARD_failure;
          return (mapping.findForward(FORWARD_final));
        }

        userObject = remote.getUserObject(individualId, firstName, lastName, userType);
        userObject.setLoginName(username);

        // In a certain case we will need a blank rights matrix, so prepare the remote connection now.
        AuthorizationHome ah = (AuthorizationHome)CVUtility.getHomeObject("com.centraview.administration.authorization.AuthorizationHome","Authorization");
        Authorization authorizationRemote = ah.create();
View Full Code Here

Examples of com.centraview.login.Login

      formEmail = (String)fpf.getEmail();

      HttpSession session = request.getSession(true);
     
      // EJB
      Login remote = (Login)lh.create();
      remote.setDataSource(dataSource);
      HashMap resultHashMap = remote.getForgottenPassword(formUserName, formEmail);
      String rand = "";
      int userid = 0;
      int individualID = 0;

      if ((String)resultHashMap.get("noemail") ==  null) {
View Full Code Here

Examples of com.changestuffs.server.persistence.beans.Login

  }
 
  @Transactional
  public InfoLoginResult persistUser(Date dateIn, com.google.appengine.api.users.User user, String ip, String pendingFriend){
    InfoLoginResult result = null;
    Login login = new Login();
    login.setIp(ip);
    login.setLoginDate(dateIn);
    log.info("Looking for id: "+user.getEmail());
        User userBean = model.find(User.class, user.getEmail());
        if(userBean != null){
          if(AUTH_DOMAIN_NOT_REGISTERED.equals(userBean.getAuthDomain()))
            setUserOpenIdValues(userBean, user);
          Date date = userBean.getLogins().get(userBean.getLogins().size()-1).getLoginDate();
          if(pendingFriend != null)
            userBean.getPendingFriends().add(pendingFriend);
          login.setUser(userBean);
          model.persist(login);
          log.info("Update user: "+user.getEmail()+" with date "+dateIn);
          result = new InfoLoginResult(user.getEmail(), date, false, userBean.isReceiveEmails(), userBean.getUserId());
        }else{
          List<Login> logins = new ArrayList<Login>();
          userBean = new User();
          setUserOpenIdValues(userBean, user);
          userBean.setReceiveEmails(true);
          userBean.setFriends(new HashSet<String>());
          userBean.setPendingFriends(new HashSet<String>());
          if(pendingFriend != null)
            userBean.getPendingFriends().add(pendingFriend);
          logins.add(login);
          userBean.setLogins(logins);
          model.persist(userBean);
          log.info("Creating user: "+user.getEmail());
          result = new InfoLoginResult(user.getEmail(), login.getLoginDate(), true, userBean.isReceiveEmails(), userBean.getUserId());
        }
        log.info("User "+userBean);
    log.info("Returning "+result);
    return result;
  }
View Full Code Here

Examples of com.changestuffs.server.persistence.beans.Login

    registeredUser.setEmail(alreadyRegistered);
    registeredUser.setUserId("userId");
    registeredUser.setReceiveEmails(receiveEmails);
    registeredUser.setPendingFriends(new HashSet<String>());
    registeredUser.setFriends(new HashSet<String>());
    registeredUser.setLogins(Arrays.asList(new Login()));
    appEntity.getTransaction().begin();
    appEntity.persist(registeredUser);
    appEntity.getTransaction().commit();
    return registeredUser;
  }
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.