Package org.gridsphere.services.core.user

Examples of org.gridsphere.services.core.user.User


        }

        log.info("Attempting to authenticate with Tsukuba GAMA service");
        GSSCredential credential = authenticate(username, password);

        User user = userManager.getUserByUserName(username);
        if (user == null) {
            log.info("User \"" + username + "\" is not exists.");
            user = importUser(username);
            log.info("User \"" + username + "\" was imported");
        } else if (user.getAttribute("tsukubagama.type") != null){
            log.info("Got imported Tsukuba GAMA User");
        } else {
            log.error("GridSphere User \"" + username + "\" is already exists.");
            return null;
        }

        activate(user, credential);

        log.debug("Exit checkAuthentication");
        return new UserDescriptor(null, user.getID(), user.getUserName());
    }
View Full Code Here


    private User importUser(String username) {
        if (log.isDebugEnabled()) {
            log.debug("Creates GridSphere User for " + username);
        }
        User tmpUser = userManager.createUser();
        tmpUser.setUserName(username);
        tmpUser.setFullName(username);
        tmpUser.setAttribute("tsukubagama.type", "myproxy");
        userManager.saveUser(tmpUser);

        PasswordEditor passEdit = passwordManager.editPassword(tmpUser);
        String randomPass = PasswordGenerator.generate();
        passEdit.setValue(randomPass);
View Full Code Here

        String username = openId.getClaimedId();
        String subject = relyingPartyManager.getRequestSubject(openId);
        log.info("GET VOMS Proxy for \"" + subject + "\"");

        GSSCredential credential = proxyInit.getVomsProxy(subject);
        User gsUser = gsUserManager.getUserByUserName(username);
        if (gsUser == null) {
            log.info("User \"" + username + "\" is not exists.");
            gsUser = gsUserManager.importUser(username);
            log.info("User \"" + username + "\" was imported");
        } else if (gsUser.getAttribute("tsukubagama.type") != null){
            log.info("Got imported Tsukuba GAMA User");
        } else {
            log.error("GridSphere User \"" + username + "\" is already exists.");
            return null;
        }

        credentialManager.activate(gsUser, credential);

        return new UserDescriptor(null, gsUser.getID(), gsUser.getUserName());
    }
View Full Code Here

   
    public User importUser(String username) {
        if (log.isDebugEnabled()) {
            log.debug("Creates GridSphere User for " + username);
        }
        User tmpUser = createAndSaveUser(username);
        setPassword(tmpUser);
        return tmpUser;
    }
View Full Code Here

    public User getUserByUserName(String username) {
        return this.userManager.getUserByUserName(username);
    }

    private User createAndSaveUser(String username) {
        User tmpUser = userManager.createUser();
        tmpUser.setUserName(username);
        tmpUser.setFullName(username);
        tmpUser.setAttribute("tsukubagama.type", "myproxy");
        userManager.saveUser(tmpUser);
        return tmpUser;
    }
View Full Code Here

    public void start(RenderFormEvent event) throws PortletException {
        log.debug("Entering start()");
        RenderRequest request = event.getRenderRequest();
        PortletSession session = request.getPortletSession();

        User user = getUser(request);
        CredentialInfo credInfo =
            (CredentialInfo)session.getAttribute(CRED_INFO);
        if (credInfo != null) {
            session.removeAttribute(CRED_INFO);
        }
View Full Code Here

        RenderRequest request = event.getRenderRequest();
        TextBean errorMessage = event.getTextBean(ERROR_MESSAGE);
        errorMessage.setStyle("error");
        errorMessage.setValue(null);

        User user = getUser(request);
        GSSCredential cred = credentialManager.getDefaultCredential(user);
        if (cred == null) {
            log.error("No active credential found.");
            setNextState(request, NO_CREDENTIAL_JSP);
            return ;
View Full Code Here

            errorMessage.setValue("Mismatched passwords");
            setNextState(request, MAIN_VIEW_JSP);
            return ;
        }

        User user = getUser(request);
        GSSCredential cred = credentialManager.getDefaultCredential(user);
        if (cred == null) {
            log.error("No active credential found.");
            setNextState(request, NO_CREDENTIAL_JSP);
            return ;
        }

        File p12File = exportPKCS12(cred, user.getUserName(), epassword);
        if (p12File == null) {
            errorMessage.setValue("Failed to export the PKCS#12 certificate");
            setNextState(request, MAIN_VIEW_JSP);
            return ;
        }
View Full Code Here

TOP

Related Classes of org.gridsphere.services.core.user.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.