org.opensaml.saml.saml1.core.Assertion.getStatements()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中org.opensaml.saml.saml1.core.Assertion.getStatements()方法的一些代码示例,展示了Assertion.getStatements()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assertion.getStatements()方法的具体详情如下:
包路径:org.opensaml.saml.saml1.core.Assertion
类名称:Assertion
方法名:getStatements

Assertion.getStatements介绍

[英]Return the List representing all the Statement sub elements.
[中]返回表示所有Statement子元素的列表。

代码示例

代码示例来源:origin: org.opensaml/opensaml-saml-impl

/** {@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);
  }
}

代码示例来源:origin: apache/cxf

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;
}

代码示例来源:origin: org.opensaml/opensaml-saml-impl

/** {@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);
  }
}

代码示例来源:origin: org.opensaml/opensaml-saml-impl

/** {@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);
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-rs-security-xml

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;
}

代码示例来源:origin: org.opensaml/opensaml-saml-impl

for (final Statement statement : assertion.getStatements()) {
  if (statement instanceof SubjectStatement) {
    final Subject subject = getStatementSubject((SubjectStatement) statement);

代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-common

for (Statement stmt : ((org.opensaml.saml.saml1.core.Assertion)samlObject).getStatements()) {
  if (stmt instanceof AttributeStatement) {
    AttributeStatement attrStmt = (AttributeStatement) stmt;

代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-common

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) {

相关文章