@Override protected Group[] getRoleSets() throws LoginException { Group roles = new SimpleGroup("Roles"); Group callerPrincipal = new SimpleGroup("CallerPrincipal"); Group[] groups = { roles, callerPrincipal }; callerPrincipal.addMember(getIdentity()); return groups; }
private void updateSubjectRoles(final org.jboss.security.SecurityContext jbossSct){ if (jbossSct == null) { throw UndertowLogger.ROOT_LOGGER.nullParamter("org.jboss.security.SecurityContext"); } RoleGroup contextRoleGroup = jbossSct.getUtil().getRoles(); if(contextRoleGroup == null){ return; } Collection<Role> contextRoles = contextRoleGroup.getRoles(); if(contextRoles.isEmpty()){ return; } Subject subject = jbossSct.getUtil().getSubject(); Set<Group> groupPrincipals = subject.getPrincipals(Group.class); Group subjectRoleGroup = null; for (Group candidate : groupPrincipals) { if (candidate.getName().equals(ROLES_IDENTIFIER)) { subjectRoleGroup = candidate; break; } } if (subjectRoleGroup == null) { subjectRoleGroup = new SimpleGroup(ROLES_IDENTIFIER); subject.getPrincipals().add(subjectRoleGroup); } for (Role role : contextRoles) { Principal rolePrincipal = new SimplePrincipal(role.getRoleName()); subjectRoleGroup.addMember(rolePrincipal); } }
/** * Add principals passed via an enumeration into a group * @param grp * @param en * @return */ public static Group addPrincipals(Group grp, Enumeration<? extends Principal> en) { while(en.hasMoreElements()) grp.addMember(en.nextElement()); return grp; }
/** * Add principals passed via an enumeration into a group * @param grp * @param en * @return */ public static Group addPrincipals(Group grp, Enumeration<? extends Principal> en) { while(en.hasMoreElements()) grp.addMember(en.nextElement()); return grp; }
public void addRole(String roleName, String roleGroup) { Group group = roleGroups.get(roleGroup); if( group == null ) { group = new SimpleGroup(roleGroup); roleGroups.put(roleGroup, group); } SimplePrincipal role = new SimplePrincipal(roleName); group.addMember(role); } public int compareTo(User obj)
@Override protected Group[] getRoleSets() throws LoginException { Group group = new SimpleGroup("Roles"); List<String> roles = FacebookProcessor.cachedRoles.get(); if (roles != null) { for (String role : roles) { group.addMember(new SimplePrincipal(role)); } } return new Group[] { group }; } }
@Override protected Group[] getRoleSets() throws LoginException { Group group = new SimpleGroup("Roles"); List<String> roles = FacebookProcessor.cachedRoles.get(); if (roles != null) { for (String role : roles) { group.addMember(new SimplePrincipal(role)); } } return new Group[] { group }; } }
@Override protected Group[] getRoleSets() throws LoginException { Group group = new SimpleGroup("Roles"); List<String> roles = OpenIDProcessor.cachedRoles.get(); if (roles != null) { for (String role : roles) { group.addMember(new SimplePrincipal(role)); } } return new Group[]{group}; } }
@Override protected Group[] getRoleSets() throws LoginException { Group group = new SimpleGroup("Roles"); List<String> roles = OpenIDProcessor.cachedRoles.get(); if (roles != null) { for (String role : roles) { group.addMember(new SimplePrincipal(role)); } } return new Group[]{group}; } }
@Override protected Group[] getRoleSets() throws LoginException { Group roles = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER); roles.addMember(new SimplePrincipal(role)); return new Group[] { roles }; }
public Group run() { Group theGroup = new PicketLinkGroup(SecurityConstants.ROLES_IDENTIFIER); for(String role: roles) { theGroup.addMember(new SimplePrincipal(role)); } return theGroup; } });
public Group run() { Group theGroup = new PicketLinkGroup(SecurityConstants.ROLES_IDENTIFIER); for (String role : roles) { theGroup.addMember(new SimplePrincipal(role)); } return theGroup; } });
public Group run() { Group theGroup = new PicketLinkGroup(SecurityConstants.ROLES_IDENTIFIER); for (String role : roles) { theGroup.addMember(new SimplePrincipal(role)); } return theGroup; } });
public Group run() { Group theGroup = new PicketLinkGroup(SecurityConstants.ROLES_IDENTIFIER); for (String role : roles) { theGroup.addMember(new SimplePrincipal(role)); } return theGroup; } });
@Override protected Group[] getRoleSets() throws LoginException { Group roles = new SimpleGroup("Roles"); Group callerPrincipal = new SimpleGroup("CallerPrincipal"); Group[] groups = { roles, callerPrincipal }; callerPrincipal.addMember(getIdentity()); return groups; }
@Override protected Group[] getRoleSets() throws LoginException { Group roles = new SimpleGroup("Roles"); Group callerPrincipal = new SimpleGroup("CallerPrincipal"); Group[] groups = {roles, callerPrincipal}; callerPrincipal.addMember(getIdentity()); return groups; }
@Override protected Group[] getRoleSets() throws LoginException { 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}; }
@Override protected Group[] getRoleSets() throws LoginException { Group roles = new SimpleGroup("Roles"); Group callerPrincipal = new SimpleGroup("CallerPrincipal"); Group[] groups = { roles, callerPrincipal }; callerPrincipal.addMember(getIdentity()); return groups; }
@Override protected Group[] getRoleSets() throws LoginException { Group roles = new SimpleGroup("Roles"); Group callerPrincipal = new SimpleGroup("CallerPrincipal"); Group[] groups = { roles, callerPrincipal }; callerPrincipal.addMember(getIdentity()); return groups; }