Package cgl.shindig.usermanage

Examples of cgl.shindig.usermanage.User


            throws ServletException, IOException {
      Logger logger = Logger.getLogger(OpenIdAuth.class.getSimpleName());
        logger.info("OpenID authentication post processing :" + openid );
        BaseHttpServlet.markOpenID(request, openid);
        try{
            User user = null;
            if( (user = UserDBMgr.getUserByOpenID(openid)) == null ){//the user is new
              BaseHttpServlet.markSignupState(request, -1);
                RedirectionHub.forward2SignPage(servlet, request, response, false);
            }else{//the user has created account before.
                ServletSessionMgr.putAuthenUserInSession(request, user.getScreenname());
                logger.info("old user openid");
                RedirectionHub.forward2Home(servlet, request, response);
            }
        }catch(Exception e){
            RedirectionHub.forward2SignPage(servlet, request, response, true);
View Full Code Here


      //The "state" notation seems a little brittle. Should just booleans.  State 2 is "false because....". 
      //Maybe use an additional "messageToUser" string that provides additional information.
        int state = 0; //succeed

        User user = new User( screenname, firstname, lastname, dob, language,
                              timezone, email, gender, postcode, openid, password,country );
      //Check that the input information elements have valid input ranges.
        if( uv.validate( user ) ){
            /* update both the user's information and layout information */
        //This will encrypt the password as a hash.
            boolean succ = UserDBMgr.insertUser( user );
            if( succ == true ){
           //Note the defaultLayoutData string is actually some non-trivial JSON loaded from
           //a file.
                UserDBMgr.insertUILayout(new UILayout(user.getScreenname(), defaultLayoutData));
                proxystoreKeyAdjust(openid, screenname);
            }else{
                state = 2; //the user with that screen name has existed.
            }
        }else{//the user has input invalid information.
View Full Code Here

        int authenzRC = authenzResult.authenzRC;
        request.setAttribute("action", "signin");
        request.setAttribute("state", new Integer(authenzRC));

        if(authenzResult.isSuccessful()){ //signin succeeded
            User user = authenzResult.user;
            request.setAttribute("user", user);
            ServletSessionMgr.putAuthenUserInSession(request, user.getScreenname());
        }
        return authenzResult;
    }
View Full Code Here

        if (portal.login(creds, null)) {
            signInCallback(userId, portal);

            // TODO: maybe it's better to make portal.login method return
            // authenticated user object?
            User user = new User();
            user.setScreenname(userId);

            authenzResult.user = user;
            authenzResult.authenzRC = 0;
        } else {
        //FIXME What is the is the significance of authenzRC==3?
View Full Code Here

        } else {
            // no SimpleCredentials: retrieve authorizables corresponding to
            // a non-group principal. the first one present is used to determine
            // the userID.
            for (Principal p : subject.getPrincipals()) {
                User authorz = systemUserManager.getUser(p);
                if (authorz != null ) {
                    uid = authorz.getScreenname();
                    break;
                }
            }
        }
        return uid;
View Full Code Here

    private static void createSystemUsers(UserManager userManager,
            String adminId, String anonymousId)
            throws Exception {
        if (adminId != null) {
            User admin = userManager.getUser(adminId);
            if (admin == null) {
                admin = userManager.createUser(adminId, adminId);
                log.info("...created admin-user with id \'" + adminId + "\' ...");
            }
        }

        if (anonymousId != null) {
            User anonymous = userManager.getUser(anonymousId);
            if (anonymous == null) {
                userManager.createUser(anonymousId, "");
                log.info("...created anonymous-user with id \'" + anonymousId + "\' ...");
            }
        }
View Full Code Here

TOP

Related Classes of cgl.shindig.usermanage.User

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.