Package org.jboss.security

Examples of org.jboss.security.SimpleGroup.addMember()


            SAMLParser parser = new SAMLParser();
            AssertionType assertion = (AssertionType) parser.parse(new ByteArrayInputStream(assertionStr.getBytes()));
            List<String> roles = AssertionUtil.getRoles(assertion, null);
            Group roleGroup = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER);
            for (String role : roles) {
                roleGroup.addMember(new SimplePrincipal(role));
            }
            return new Group[] { roleGroup };
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here


        Group group = new SimpleGroup(groupName);

        List<String> roles = ServiceProviderSAMLContext.getRoles();
        if (roles != null) {
            for (String role : roles) {
                group.addMember(new SimplePrincipal(role));
            }
        }
        return new Group[] { group };
    }
View Full Code Here

            RoleGroup group = roleMappingContext.getMappingResult().getMappedObject();

            SimpleGroup rolePrincipal = new SimpleGroup(group.getRoleName());

            for (Role role : group.getRoles()) {
                rolePrincipal.addMember(new SimplePrincipal(role.getRoleName()));
            }
            subject.getPrincipals().add(rolePrincipal);
        } else {
            List<String> roleKeys = new ArrayList<String>();
            roleKeys.addAll(StringUtil.tokenize(roleKey));
View Full Code Here

            List<String> roles = AssertionUtil.getRoles(assertion, roleKeys);
            if (roles.size() > 0) {
                SimpleGroup group = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER);
                for (String role : roles) {
                    group.addMember(new SimplePrincipal(role));
                }
                subject.getPrincipals().add(group);
            }
        }
View Full Code Here

        if (injectCallerPrincipalGroup) {
            Group callerPrincipal = new SimpleGroup("CallerPrincipal");
            List<String> roles = AssertionUtil.getRoles(assertion, null);
            for (String role : roles) {
                callerPrincipal.addMember(new SimplePrincipal(role));
            }
            subject.getPrincipals().add(callerPrincipal);
        }
    }
View Full Code Here

        SecurityContext securityContext = new JBossSecurityContext("jmx-console");
        SecurityContextAssociation.setSecurityContext(securityContext);

        Principal principal = new SimplePrincipal("bmozaffa");
        SimpleGroup group = new SimpleGroup(SAML20TokenRoleAttributeProvider.JBOSS_ROLE_PRINCIPAL_NAME);
        group.addMember(new SimplePrincipal("myTestRole"));
        Subject newSubject = new Subject();
        newSubject.getPrincipals().add(principal);
        newSubject.getPrincipals().add(group);
        SecurityContextAssociation.getSecurityContext().getUtil().createSubjectInfo(principal, null, newSubject);
View Full Code Here

        if (this.identity instanceof Authentication) {
            Authentication user = (Authentication) this.identity;

            for (int i = 0; i < user.getAuthorities().length; i++) {
                roles.addMember(new SimplePrincipal(user.getAuthorities()[i].getAuthority()));
            }
        }

        return roleSets;
    }
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.