Examples of GroupPrincipal


Examples of org.apache.karaf.jaas.boot.principal.GroupPrincipal

                }
            }
            assertEquals(1, engine.listGroups(upa).size());
            assertEquals(2, engine.listGroups(upb).size());

            GroupPrincipal gp = engine.listGroups(upa).iterator().next();
            engine.deleteGroupRole("g", "role2");
            assertEquals(1, engine.listRoles(gp).size());
            assertEquals("role3", engine.listRoles(gp).iterator().next().getName());

            // Check that the user roles are reported correctly
View Full Code Here

Examples of org.apache.karaf.jaas.boot.principal.GroupPrincipal

        principals = new HashSet<Principal>();
        principals.add(new UserPrincipal(user));
        for (int i = 1; i < infos.length; i++) {
            if (infos[i].trim().startsWith(PropertiesBackingEngine.GROUP_PREFIX)) {
                // it's a group reference
                principals.add(new GroupPrincipal(infos[i].trim().substring(PropertiesBackingEngine.GROUP_PREFIX.length())));
                String groupInfo = (String) users.get(infos[i].trim());
                if (groupInfo != null) {
                    String[] roles = groupInfo.split(",");
                    for (int j = 1; j < roles.length; j++) {
                        principals.add(new RolePrincipal(roles[j].trim()));
View Full Code Here

Examples of org.apache.karaf.jaas.boot.principal.GroupPrincipal

        if (userInfo != null) {
            String[] infos = userInfo.split(",");
            for (int i = 1; i < infos.length; i++) {
                String name = infos[i];
                if (name.startsWith(GROUP_PREFIX)) {
                    result.add(new GroupPrincipal(name.substring(GROUP_PREFIX.length())));
                }
            }
        }
        return result;
    }
View Full Code Here

Examples of org.apache.karaf.jaas.boot.principal.GroupPrincipal

        principals = new HashSet<Principal>();
        principals.add(new UserPrincipal(user));
        for (int i = 1; i < infos.length; i++) {
            if (infos[i].trim().startsWith(PropertiesBackingEngine.GROUP_PREFIX)) {
                // it's a group reference
                principals.add(new GroupPrincipal(infos[i].trim().substring(PropertiesBackingEngine.GROUP_PREFIX.length())));
                String groupInfo = (String) users.get(infos[i].trim());
                if (groupInfo != null) {
                    String[] roles = groupInfo.split(",");
                    for (int j = 1; j < roles.length; j++) {
                        principals.add(new RolePrincipal(roles[j].trim()));
View Full Code Here

Examples of org.apache.karaf.jaas.boot.principal.GroupPrincipal

        if (userInfo != null) {
            String[] infos = userInfo.split(",");
            for (int i = 1; i < infos.length; i++) {
                String name = infos[i];
                if (name.startsWith(GROUP_PREFIX)) {
                    result.add(new GroupPrincipal(name.substring(GROUP_PREFIX.length())));
                }
            }
        }
        return result;
    }
View Full Code Here

Examples of org.apache.openejb.core.security.jaas.GroupPrincipal

        public void login(String user, String... roles) throws LoginException {
            Set<Principal> set = new HashSet<Principal>();
            set.add(new UserPrincipal(user));
            for (String role : roles) {
                set.add(new GroupPrincipal(role));
            }
            Subject subject = new Subject(true, set, Collections.EMPTY_SET, Collections.EMPTY_SET);
            UUID uuid = registerSubject(subject);
            associate(uuid);
        }
View Full Code Here

Examples of org.apache.openejb.core.security.jaas.GroupPrincipal

        public void login(String user, String... roles) throws LoginException {
            Set<Principal> set = new HashSet<Principal>();
            set.add(new UserPrincipal(user));
            for (String role : roles) {
                set.add(new GroupPrincipal(role));
            }
            Subject subject = new Subject(true, set, Collections.EMPTY_SET, Collections.EMPTY_SET);
            UUID uuid = registerSubject(subject);
            associate(uuid);
        }
View Full Code Here

Examples of org.apache.openejb.core.security.jaas.GroupPrincipal

        public void login(String user, String... roles) throws LoginException {
            Set<Principal> set = new HashSet<Principal>();
            set.add(new UserPrincipal(user));
            for (String role : roles) {
                set.add(new GroupPrincipal(role));
            }
            Subject subject = new Subject(true, set, Collections.EMPTY_SET, Collections.EMPTY_SET);
            UUID uuid = registerSubject(subject);
            associate(uuid);
        }
View Full Code Here

Examples of org.apache.openejb.core.security.jaas.GroupPrincipal

        return true;
    }

    public boolean commit() throws LoginException {
        principals.add(new UserPrincipal(user));
        principals.add(new GroupPrincipal(user));

        subject.getPrincipals().addAll(principals);

        user = null;
        return true;
View Full Code Here

Examples of org.apache.qpid.server.security.group.GroupPrincipal

    {
        final Set<Principal> principals = new HashSet<Principal>(1 + groups.length);
        principals.add(new AuthenticatedPrincipal(username));
        for (String group : groups)
        {
            principals.add(new GroupPrincipal(group));
        }

        return new Subject(true, principals, Collections.EMPTY_SET, Collections.EMPTY_SET);
    }
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.