Package org.switchyard.security.principal

Examples of org.switchyard.security.principal.GroupPrincipal


    }

    private Set<Credential> getCredentials() throws Exception {
        UserPrincipal user = new UserPrincipal("testUser");
        RolePrincipal role = new RolePrincipal("testRole");
        GroupPrincipal parentGroup = new GroupPrincipal("testParentGroup");
        parentGroup.addMember(user);
        GroupPrincipal childGroup = new GroupPrincipal("testChildGroup");
        childGroup.addMember(role);
        parentGroup.addMember(childGroup);
        Set<Credential> creds = new LinkedHashSet<Credential>();
        creds.add(new AssertionCredential(new ElementPuller().pull(new StringReader("<testAssertion/>"))));
        creds.add(SOAPMessageCredentialExtractorTests.getBinarySecurityTokenCertificateCredential());
        creds.add(new ConfidentialityCredential(true));
View Full Code Here


                Set<GroupPrincipal> groups = getSubject().getPrincipals(GroupPrincipal.class);
                Set<String> roleNames = Strings.uniqueSplitTrimToNull(rolesProperties.getProperty(userName), ",");
                for (String roleName : roleNames) {
                    RolePrincipal role = new RolePrincipal(roleName);
                    if (groups.isEmpty()) {
                        GroupPrincipal rolesGroup = new GroupPrincipal(GroupPrincipal.ROLES);
                        rolesGroup.addMember(role);
                        getSubject().getPrincipals().add(rolesGroup);
                    } else {
                        for (GroupPrincipal group : groups) {
                            if (GroupPrincipal.ROLES.equals(group.getName())) {
                                group.addMember(role);
View Full Code Here

                    MappingResult<RoleGroup> rolesResult = new MappingResult<RoleGroup>();
                    rolesMapper.setMappingResult(rolesResult);
                    rolesMapper.performMapping(contextMap, null);
                    RoleGroup roleGroup = rolesResult.getMappedObject();
                    if (roleGroup != null) {
                        GroupPrincipal roles = null;
                        for (Role role : roleGroup.getRoles()) {
                            if (roles == null) {
                                roles = new GroupPrincipal(GroupPrincipal.ROLES);
                            }
                            roles.addMember(new RolePrincipal(role.getRoleName()));
                        }
                        if (roles != null) {
                            sts_subject.getPrincipals().add(roles);
                            sts_mapped = true;
                        }
View Full Code Here

                rolesGroup = group;
                break;
            }
        }
        if (rolesGroup == null) {
            rolesGroup = new GroupPrincipal(GroupPrincipal.ROLES);
            subject.getPrincipals().add(rolesGroup);
        }
        return rolesGroup;
    }
View Full Code Here

TOP

Related Classes of org.switchyard.security.principal.GroupPrincipal

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.