public static Map<String, Object> asMap(Set<AttributeStatementType> attributeStatementTypes) { Map<String, Object> attrMap = new HashMap<String, Object>(); if (attributeStatementTypes != null && !attributeStatementTypes.isEmpty()) { attrMap = new HashMap<String, Object>(); for (StatementAbstractType statement : attributeStatementTypes) { if (statement instanceof AttributeStatementType) { AttributeStatementType attrStat = (AttributeStatementType) statement; List<ASTChoiceType> attrs = attrStat.getAttributes(); for (ASTChoiceType attrChoice : attrs) { AttributeType attr = attrChoice.getAttribute(); String attributeName = attr.getFriendlyName(); if (attributeName == null) { attributeName = attr.getName(); } List<Object> values = attr.getAttributeValue(); if (values != null) { if (values.size() == 1) { attrMap.put(attributeName, values.get(0)); } else { attrMap.put(attributeName, values); } } } } } } return attrMap; }
public void writeAttributeTypeWithoutRootTag(AttributeType attributeType) throws ProcessingException { String attributeName = attributeType.getName(); if (attributeName != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.NAME.get(), attributeName);
public static Map<String, Object> asMap(Set<AttributeStatementType> attributeStatementTypes) { Map<String, Object> attrMap = new HashMap<String, Object>(); if (attributeStatementTypes != null && !attributeStatementTypes.isEmpty()) { attrMap = new HashMap<String, Object>(); for (StatementAbstractType statement : attributeStatementTypes) { if (statement instanceof AttributeStatementType) { AttributeStatementType attrStat = (AttributeStatementType) statement; List<ASTChoiceType> attrs = attrStat.getAttributes(); for (ASTChoiceType attrChoice : attrs) { AttributeType attr = attrChoice.getAttribute(); String attributeName = attr.getFriendlyName(); if (attributeName == null) { attributeName = attr.getName(); } List<Object> values = attr.getAttributeValue(); if (values != null) { if (values.size() == 1) { attrMap.put(attributeName, values.get(0)); } else { attrMap.put(attributeName, values); } } } } } } return attrMap; }
public void writeAttributeTypeWithoutRootTag(AttributeType attributeType) throws ProcessingException { String attributeName = attributeType.getName(); if (attributeName != null) { StaxUtil.writeAttribute(writer, JBossSAMLConstants.NAME.get(), attributeName);
AttributeType attr = obj.getAttribute(); if (roleKeys != null && roleKeys.size() > 0) { if (!roleKeys.contains(attr.getName())) continue;
AttributeType attr = obj.getAttribute(); if (roleKeys != null && roleKeys.size() > 0) { if (!roleKeys.contains(attr.getName())) continue;
AttributeType attr = obj.getAttribute(); if (roleKeys != null && roleKeys.size() > 0) { if (!roleKeys.contains(attr.getName())) continue;
attributeName = attr.getFriendlyName(); } else { attributeName = attr.getName();
List<ASTChoiceType> attributes = attrStatement.getAttributes(); for (ASTChoiceType astChoiceType : attributes) { if (astChoiceType.getAttribute() != null && astChoiceType.getAttribute().getName().equals("Role")) { //$NON-NLS-1$ List<Object> values = astChoiceType.getAttribute().getAttributeValue(); for (Object roleValue : values) {
attrMap.put(attr.getFriendlyName(), attr.getAttributeValue()); } else { attrMap.put(attr.getName(), attr.getAttributeValue());
attrMap.put(attr.getName(), attr.getAttributeValue());
attrMap.put(attr.getName(), attr.getAttributeValue());
attributeName = attr.getFriendlyName(); } else { attributeName = attr.getName();
AttributeType attr = obj.getAttribute(); if (roleKeys.size() > 0) { if (!roleKeys.contains(attr.getName())) continue;
/** * Consumes the assertion, resulting in the extraction of the Subject as the JAAS principal and the Role Statements as the JAAS * roles. * * @param assertion * * @throws Exception */ private void consumeAssertion(AssertionType assertion) throws Exception { SubjectType samlSubjectType = assertion.getSubject(); String samlSubject = ((NameIDType) samlSubjectType.getSubType().getBaseID()).getValue(); identity = createIdentity(samlSubject); Set<StatementAbstractType> statements = assertion.getStatements(); for (StatementAbstractType statement : statements) { if (statement instanceof AttributeStatementType) { AttributeStatementType attrStatement = (AttributeStatementType) statement; List<ASTChoiceType> attributes = attrStatement.getAttributes(); for (ASTChoiceType astChoiceType : attributes) { if (astChoiceType.getAttribute() != null && astChoiceType.getAttribute().getName().equals("Role")) { List<Object> values = astChoiceType.getAttribute().getAttributeValue(); for (Object roleValue : values) { if (roleValue != null) { roles.add(roleValue.toString()); } } } } } } }
/** * Consumes the assertion, resulting in the extraction of the Subject as the * JAAS principal and the Role Statements as the JAAS roles. * @param assertion * @throws Exception */ private void consumeAssertion(AssertionType assertion) throws Exception { SubjectType samlSubjectType = assertion.getSubject(); String samlSubject = ((NameIDType) samlSubjectType.getSubType().getBaseID()).getValue(); identity = createIdentity(samlSubject); Set<StatementAbstractType> statements = assertion.getStatements(); for (StatementAbstractType statement : statements) { if (statement instanceof AttributeStatementType) { AttributeStatementType attrStatement = (AttributeStatementType) statement; List<ASTChoiceType> attributes = attrStatement.getAttributes(); for (ASTChoiceType astChoiceType : attributes) { if (astChoiceType.getAttribute() != null && astChoiceType.getAttribute().getName().equals("Role")) { //$NON-NLS-1$ List<Object> values = astChoiceType.getAttribute().getAttributeValue(); for (Object roleValue : values) { if (roleValue != null) { roles.add(roleValue.toString()); } } } } } } }
/** * Consumes the assertion, resulting in the extraction of the Subject as the JAAS principal and the Role Statements as the JAAS * roles. * * @param assertion * * @throws Exception */ private void consumeAssertion(AssertionType assertion) throws Exception { SubjectType samlSubjectType = assertion.getSubject(); String samlSubject = ((NameIDType) samlSubjectType.getSubType().getBaseID()).getValue(); identity = createIdentity(samlSubject); Set<StatementAbstractType> statements = assertion.getStatements(); for (StatementAbstractType statement : statements) { if (statement instanceof AttributeStatementType) { AttributeStatementType attrStatement = (AttributeStatementType) statement; List<ASTChoiceType> attributes = attrStatement.getAttributes(); for (ASTChoiceType astChoiceType : attributes) { if (astChoiceType.getAttribute() != null && astChoiceType.getAttribute().getName().equals("Role")) { List<Object> values = astChoiceType.getAttribute().getAttributeValue(); for (Object roleValue : values) { if (roleValue != null) { roles.add(roleValue.toString()); } } } } } } }
List<ASTChoiceType> attributes = attrStatement.getAttributes(); for (ASTChoiceType astChoiceType : attributes) { if (astChoiceType.getAttribute() != null && astChoiceType.getAttribute().getName().equals("Role")) { //$NON-NLS-1$ List<Object> values = astChoiceType.getAttribute().getAttributeValue(); for (Object roleValue : values) {
if (attribute != null) { if (tokenRoleAttributeName.equals(attribute.getName())) { for (Object value : attribute.getAttributeValue()) { rolesGroup.addRole(new SimpleRole((String) value));
if (attribute != null) { if (tokenRoleAttributeName.equals(attribute.getName())) { for (Object value : attribute.getAttributeValue()) { rolesGroup.addRole(new SimpleRole((String) value));