Package org.picketlink.idm.impl.api.model

Examples of org.picketlink.idm.impl.api.model.SimpleUser


                    PasswordCredential password = (PasswordCredential) credentials.getCredential();
                    String hashedPassword = securityUtil.hash(u, password.getValue());
                    if (hashedPassword.equals(u.getPassword())) {
                        loginEvent.fire(u);
                        u.setDateLastLogin(new Date());
                        setUser(new SimpleUser(u.getContact().getEmailAddress()));
                        setStatus(AuthenticationStatus.SUCCESS);
                        eventLog.fire(new EventLog(u, "User Logged In"));
                    } else {
                        messages.info("Incorrect Password");
                        setStatus(AuthenticationStatus.FAILURE);
View Full Code Here


        conversation.begin();
        this.username = username;

        roles = new ArrayList<Role>();

        Collection<RoleType> roleTypes = identitySession.getRoleManager().findUserRoleTypes(new SimpleUser(username));

        for (RoleType roleType : roleTypes) {
            roles.addAll(identitySession.getRoleManager().findRoles(username, roleType.getName()));
        }
View Full Code Here

    }

    public
    @Transactional
    void deleteUser(String username) throws IdentityException {
        identitySession.getPersistenceManager().removeUser(new SimpleUser(username), true);
    }
View Full Code Here

            user.getPassword().equals(((PasswordCredential) credentials.getCredential()).getValue())) {
            loginEventSrc.fire(user);
            messages.info(new DefaultBundleKey("identity_loggedIn"), user.getName()).defaults("You're signed in as {0}")
                    .params(user.getName());
            setStatus(AuthenticationStatus.SUCCESS);
            setUser(new SimpleUser(user.getUsername())); //TODO confirm the need for this set method
            return;
        }

        messages.error(new DefaultBundleKey("identity_loginFailed")).defaults("Invalid username or password");
        setStatus(AuthenticationStatus.FAILURE);
View Full Code Here

            identity.addGroup("USERS", "GROUP");
        }

        // Let any user log in
        setStatus(AuthenticationStatus.SUCCESS);
        setUser(new SimpleUser(credentials.getUsername()));
    }
View Full Code Here

    public void authenticate() {
        if ("demo".equals(credentials.getUsername()) &&
                credentials.getCredential() instanceof PasswordCredential &&
                "demo".equals(((PasswordCredential) credentials.getCredential()).getValue())) {
            setStatus(AuthenticationStatus.SUCCESS);
            setUser(new SimpleUser("demo"));           
            log.info("Authentication successful for user '" + credentials.getUsername() + "'");
        } else {                   
            setStatus(AuthenticationStatus.FAILURE);           
            log.info("Authentication failed for user '" + credentials.getUsername() + "'");           
        }
View Full Code Here

        AttributesManager am = session.getAttributesManager();

        Map<String, Attribute> attrs = null;

        try {
            attrs = am.getAttributes(new SimpleUser(user.getUserName()));
        } catch (Exception e) {

            handleException("Cannot obtain attributes for user: " + user.getUserName() + "; ", e);

        }
View Full Code Here

    public void authenticate() {
        if ("demo".equals(credentials.getUsername())
                && credentials.getCredential() instanceof PasswordCredential
                && "demo".equals(((PasswordCredential) credentials.getCredential()).getValue())) {
            setStatus(AuthenticationStatus.SUCCESS);
            setUser(new SimpleUser("demo"));
        } else if ("admin".equals(credentials.getUsername())
                && credentials.getCredential() instanceof PasswordCredential
                && "admin".equals(((PasswordCredential) credentials.getCredential()).getValue())) {
            setStatus(AuthenticationStatus.SUCCESS);
            setUser(new SimpleUser("admin"));
        }
    }
View Full Code Here

TOP

Related Classes of org.picketlink.idm.impl.api.model.SimpleUser

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.