/** {@inheritDoc} */ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException { AttributeStatement attributeStatement = (AttributeStatement) parentSAMLObject; if (childSAMLObject instanceof Attribute) { attributeStatement.getAttributes().add((Attribute) childSAMLObject); } else { super.processChildElement(parentSAMLObject, childSAMLObject); } } }
attrStatement.setSubject(subject); for (final Map.Entry<String, Object> e : attributes.entrySet()) { if (e.getValue() instanceof Collection<?> && ((Collection<?>) e.getValue()).isEmpty()) { attribute.getAttributeValues().add(newAttributeValue(e.getValue(), AttributeValue.DEFAULT_ELEMENT_NAME)); attrStatement.getAttributes().add(attribute);
LOG.finest("parsing statement: " + statement.getElementQName()); List<org.opensaml.saml.saml1.core.Attribute> attributes = statement.getAttributes(); for (org.opensaml.saml.saml1.core.Attribute attribute : attributes) { if (LOG.isLoggable(Level.FINEST)) {
private static org.opensaml.saml.saml1.core.Subject getSaml1Subject(SamlAssertionWrapper assertionW) { for (Statement stmt : assertionW.getSaml1().getStatements()) { org.opensaml.saml.saml1.core.Subject samlSubject = null; if (stmt instanceof AttributeStatement) { AttributeStatement attrStmt = (AttributeStatement) stmt; samlSubject = attrStmt.getSubject(); } else if (stmt instanceof AuthenticationStatement) { AuthenticationStatement authStmt = (AuthenticationStatement) stmt; samlSubject = authStmt.getSubject(); } else { AuthorizationDecisionStatement authzStmt = (AuthorizationDecisionStatement)stmt; samlSubject = authzStmt.getSubject(); } if (samlSubject != null) { return samlSubject; } } return null; }
private static org.opensaml.saml.saml1.core.Subject getSaml1Subject(SamlAssertionWrapper assertionW) { for (Statement stmt : assertionW.getSaml1().getStatements()) { org.opensaml.saml.saml1.core.Subject samlSubject = null; if (stmt instanceof AttributeStatement) { AttributeStatement attrStmt = (AttributeStatement) stmt; samlSubject = attrStmt.getSubject(); } else if (stmt instanceof AuthenticationStatement) { AuthenticationStatement authStmt = (AuthenticationStatement) stmt; samlSubject = authStmt.getSubject(); } else { AuthorizationDecisionStatement authzStmt = (AuthorizationDecisionStatement)stmt; samlSubject = authzStmt.getSubject(); } if (samlSubject != null) { return samlSubject; } } return null; }
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; } }
Subject attributeSubject = SAML1ComponentBuilder.createSaml1v1Subject(statementBean.getSubject()); attributeStatement.setSubject(attributeSubject); attributeValues ); attributeStatement.getAttributes().add(samlAttribute);
LOG.finest("parsing statement: " + statement.getElementQName()); List<org.opensaml.saml.saml1.core.Attribute> attributes = statement.getAttributes(); for (org.opensaml.saml.saml1.core.Attribute attribute : attributes) { if (LOG.isLoggable(Level.FINEST)) {
if (statement.getSubject() != null && statement.getSubject().getNameIdentifier() != null) { return statement.getSubject().getNameIdentifier().getFormat();
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; } }
attrStatement.setSubject(newSubject(state.getPrincipalName())); for (final String attrName : ticketResponse.getAttributes().keySet()) { final Attribute attribute = newSAMLObject(Attribute.class, Attribute.DEFAULT_ELEMENT_NAME); attribute.getAttributeValues().add(newAttributeValue(value)); attrStatement.getAttributes().add(attribute);
if (statement.getSubject() != null && statement.getSubject().getNameIdentifier() != null) { return statement.getSubject().getNameIdentifier().getValue();
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"; } }
if (stmt instanceof AttributeStatement) { AttributeStatement attrStmt = (AttributeStatement) stmt; samlSubject = attrStmt.getSubject(); } else if (stmt instanceof AuthenticationStatement) { AuthenticationStatement authStmt = (AuthenticationStatement) stmt;
statement.getAttributes().addAll(encodedAttributes); return statement;
org.opensaml.saml.saml1.core.AttributeStatement attrStmt = (org.opensaml.saml.saml1.core.AttributeStatement) stmt; samlSubject = attrStmt.getSubject(); } else if (stmt instanceof org.opensaml.saml.saml1.core.AuthenticationStatement) { org.opensaml.saml.saml1.core.AuthenticationStatement authStmt =
assertion.getAttributeStatements().stream().flatMap(attributeStatement -> attributeStatement.getAttributes().stream()).forEach(item -> { LOGGER.debug("Processed attribute: [{}]", item.getAttributeName()); final List<Object> itemList = item.getAttributeValues().stream()
for (final Attribute item : attributeStatement.getAttributes()) { LOGGER.debug("Processed attribute: {}", item.getAttributeName());
for (org.opensaml.saml.saml1.core.AttributeStatement attributeStatement : wrapper.getSaml1().getAttributeStatements()) { for (org.opensaml.saml.saml1.core.Attribute attribute : attributeStatement.getAttributes()) { if ("ActAs".equals(attribute.getAttributeName())) { for (XMLObject attributeValue : attribute.getAttributeValues()) {
for (org.opensaml.saml.saml1.core.AttributeStatement attributeStatement : wrapper.getSaml1().getAttributeStatements()) { for (org.opensaml.saml.saml1.core.Attribute attribute : attributeStatement.getAttributes()) { if ("ActAs".equals(attribute.getAttributeName())) { for (XMLObject attributeValue : attribute.getAttributeValues()) {