/** {@inheritDoc} */ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException { Assertion assertion = (Assertion) parentSAMLObject; if (childSAMLObject instanceof Signature) { assertion.setSignature((Signature) childSAMLObject); } else if (childSAMLObject instanceof Conditions) { assertion.setConditions((Conditions) childSAMLObject); } else if (childSAMLObject instanceof Advice) { assertion.setAdvice((Advice) childSAMLObject); } else if (childSAMLObject instanceof Statement) { assertion.getStatements().add((Statement) childSAMLObject); } else { super.processChildElement(parentSAMLObject, childSAMLObject); } }
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; }
/** {@inheritDoc} */ @Override protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) { int count = 0; for (final Assertion assertion : response.getAssertions()) { for (final Statement statement : assertion.getStatements()) { if (statement instanceof SubjectStatement) { final Subject subject = getStatementSubject((SubjectStatement) statement); final NameIdentifier existing = subject.getNameIdentifier(); if (existing == null || overwriteExisting) { subject.setNameIdentifier(cloneNameIdentifier()); count ++; } } } } if (count > 0) { log.debug("{} Added NameIdentifier to {} statement subject(s)", getLogPrefix(), count); } }
/** {@inheritDoc} */ @Override protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) { final NameIdentifier nameIdentifier = generateNameIdentifier(profileRequestContext); if (nameIdentifier == null) { log.debug("{} Unable to generate a NameIdentifier, leaving empty", getLogPrefix()); return; } int count = 0; for (final Assertion assertion : assertions) { for (final Statement statement : assertion.getStatements()) { if (statement instanceof SubjectStatement) { final Subject subject = getStatementSubject((SubjectStatement) statement); final NameIdentifier existing = subject.getNameIdentifier(); if (existing == null || overwriteExisting) { subject.setNameIdentifier(count > 0 ? cloneNameIdentifier(nameIdentifier) : nameIdentifier); count ++; } } } } if (count > 0) { log.debug("{} Added NameIdentifier to {} statement subject(s)", getLogPrefix(), count); } }
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; }
for (final Statement statement : assertion.getStatements()) { if (statement instanceof SubjectStatement) { final Subject subject = getStatementSubject((SubjectStatement) statement);
for (Statement stmt : ((org.opensaml.saml.saml1.core.Assertion)samlObject).getStatements()) { if (stmt instanceof AttributeStatement) { AttributeStatement attrStmt = (AttributeStatement) stmt;
CallbackHandler callbackHandler ) throws WSSecurityException { for (org.opensaml.saml.saml1.core.Statement stmt : assertion.getStatements()) { org.opensaml.saml.saml1.core.Subject samlSubject = null; if (stmt instanceof org.opensaml.saml.saml1.core.AttributeStatement) {