/** {@inheritDoc} */ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException { Attribute attribute = (Attribute) parentSAMLObject; QName childQName = childSAMLObject.getElementQName(); if ("AttributeValue".equals(childQName.getLocalPart()) && childQName.getNamespaceURI().equals(SAMLConstants.SAML1_NS)) { attribute.getAttributeValues().add(childSAMLObject); } else { super.processChildElement(parentSAMLObject, childSAMLObject); } } }
private boolean findClaimInAssertion(org.opensaml.saml.saml1.core.Assertion assertion, URI claimURI) { List<org.opensaml.saml.saml1.core.AttributeStatement> attributeStatements = assertion.getAttributeStatements(); if (attributeStatements == null || attributeStatements.isEmpty()) { return false; } for (org.opensaml.saml.saml1.core.AttributeStatement statement : attributeStatements) { List<org.opensaml.saml.saml1.core.Attribute> attributes = statement.getAttributes(); for (org.opensaml.saml.saml1.core.Attribute attribute : attributes) { URI attributeNamespace = URI.create(attribute.getAttributeNamespace()); String desiredRole = attributeNamespace.relativize(claimURI).toString(); if (attribute.getAttributeName().equals(desiredRole) && attribute.getAttributeValues() != null && !attribute.getAttributeValues().isEmpty()) { return true; } } } return false; } }
private boolean findClaimInAssertion(org.opensaml.saml.saml1.core.Assertion assertion, URI claimURI) { List<org.opensaml.saml.saml1.core.AttributeStatement> attributeStatements = assertion.getAttributeStatements(); if (attributeStatements == null || attributeStatements.isEmpty()) { return false; } for (org.opensaml.saml.saml1.core.AttributeStatement statement : attributeStatements) { List<org.opensaml.saml.saml1.core.Attribute> attributes = statement.getAttributes(); for (org.opensaml.saml.saml1.core.Attribute attribute : attributes) { URI attributeNamespace = URI.create(attribute.getAttributeNamespace()); String desiredRole = attributeNamespace.relativize(claimURI).toString(); if (attribute.getAttributeName().equals(desiredRole) && attribute.getAttributeValues() != null && !attribute.getAttributeValues().isEmpty()) { return true; } } } return false; } }
protected String findClaimInAssertion(org.opensaml.saml.saml1.core.Assertion assertion, URI claimURI) { List<org.opensaml.saml.saml1.core.AttributeStatement> attributeStatements = assertion.getAttributeStatements(); if (attributeStatements == null || attributeStatements.isEmpty()) { return "Attribute " + claimURI + " not found in the SAMLAssertion"; } for (org.opensaml.saml.saml1.core.AttributeStatement statement : attributeStatements) { List<org.opensaml.saml.saml1.core.Attribute> attributes = statement.getAttributes(); for (org.opensaml.saml.saml1.core.Attribute attribute : attributes) { URI attributeNamespace = URI.create(attribute.getAttributeNamespace()); String desiredRole = attributeNamespace.relativize(claimURI).toString(); if (attribute.getAttributeName().equals(desiredRole) && attribute.getAttributeValues() != null && !attribute.getAttributeValues().isEmpty()) { return null; } } } return "Attribute " + claimURI + " not found in the SAMLAssertion"; } }
final Collection<?> c = (Collection<?>) e.getValue(); for (final Object value : c) { attribute.getAttributeValues().add(newAttributeValue(value, AttributeValue.DEFAULT_ELEMENT_NAME)); attribute.getAttributeValues().add(newAttributeValue(e.getValue(), AttributeValue.DEFAULT_ELEMENT_NAME));
continue; for (XMLObject attributeValue : attribute.getAttributeValues()) { Element attributeValueElement = attributeValue.getDOM(); String value = attributeValueElement.getTextContent();
stringBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME); attribute1.setValue((String)value); attribute.getAttributeValues().add(attribute1); } else if (value instanceof XMLObject) { attribute.getAttributeValues().add((XMLObject)value);
continue; for (XMLObject attributeValue : attribute.getAttributeValues()) { Element attributeValueElement = attributeValue.getDOM(); String value = attributeValueElement.getTextContent();
assertion.getAttributeStatements().stream().flatMap(attributeStatement -> attributeStatement.getAttributes().stream()).forEach(item -> { LOGGER.debug("Processed attribute: [{}]", item.getAttributeName()); final List<Object> itemList = item.getAttributeValues().stream() .map(xmlObject -> ((XSAny) xmlObject).getTextContent()) .collect(Collectors.toList());
for (int i = 0; i < item.getAttributeValues().size(); i++) { itemList.add(((XSAny) item.getAttributeValues().get(i)).getTextContent());
attribute.setAttributeNamespace(NAMESPACE); for (final String value : ticketResponse.getAttributes().get(attrName)) { attribute.getAttributeValues().add(newAttributeValue(value));
for (org.opensaml.saml.saml1.core.Attribute attribute : attributeStatement.getAttributes()) { if ("ActAs".equals(attribute.getAttributeName())) { for (XMLObject attributeValue : attribute.getAttributeValues()) { Element attributeValueElement = attributeValue.getDOM(); String text = attributeValueElement.getTextContent();
for (org.opensaml.saml.saml1.core.Attribute attribute : attributeStatement.getAttributes()) { if ("ActAs".equals(attribute.getAttributeName())) { for (XMLObject attributeValue : attribute.getAttributeValues()) { Element attributeValueElement = attributeValue.getDOM(); String text = attributeValueElement.getTextContent();
claim.setNameFormat(atr.getAttributeNamespace()); for (XMLObject o : atr.getAttributeValues()) { String attrValue = o.getDOM().getTextContent(); claim.getValues().add(attrValue);