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

x33g5p2x  于2022-01-17 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(117)

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

Assertion.getStatements介绍

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

代码示例

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

/**
   * Test that the provided assertion has some statements in 
   * @param assertion
   * @throws ValidationException
   */
  protected void validateStatements(Assertion assertion) throws ValidationException {
    List <Statement> list = assertion.getStatements();
     if (list == null || list.size() == 0) {
       throw new ValidationException("No Statements present");
     }
  }
}

代码示例来源:origin: org.apache.rampart/rampart-trust

/**
 * Get subject confirmation method of the given SAML 1.1 Assertion.
 * This is used in rampart-core.
 * @param assertion SAML 1.1 Assertion
 * @return subject confirmation method
 */
public static String getSAML11SubjectConfirmationMethod(Assertion assertion) {
  String subjectConfirmationMethod = RahasConstants.SAML11_SUBJECT_CONFIRMATION_HOK;
  // iterate the statements and get the subject confirmation method.
  List<Statement> statements = assertion.getStatements();
  // TODO check whether there is an efficient method of doing this
  if (!statements.isEmpty()) {
    SubjectStatement subjectStatement = (SubjectStatement) statements.get(0);
    Subject subject = subjectStatement.getSubject();
    if (subject != null) {
      SubjectConfirmation subjectConfirmation = subject.getSubjectConfirmation();
      if (subjectConfirmation != null) {
        List<ConfirmationMethod> confirmationMethods = subjectConfirmation.getConfirmationMethods();
        if (!confirmationMethods.isEmpty()) {
          subjectConfirmationMethod = confirmationMethods.get(0).getConfirmationMethod();
        }
      }
    }
  }
  return subjectConfirmationMethod;
}

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

/** {@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: org.apache.rampart/rampart-trust

assertion.getStatements().addAll(statements);
assertion.setID(UIDGenerator.generateUID());
assertion.setIssueInstant(new DateTime());

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

for (org.opensaml.saml1.core.Statement stmt : assertion.getSaml1().getStatements()) {
  if (stmt instanceof org.opensaml.saml1.core.AttributeStatement) {
    org.opensaml.saml1.core.AttributeStatement attrStmt =

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.wss4j

for (org.opensaml.saml1.core.Statement stmt : assertion.getSaml1().getStatements()) {
  if (stmt instanceof org.opensaml.saml1.core.AttributeStatement) {
    org.opensaml.saml1.core.AttributeStatement attrStmt =

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

for (org.opensaml.saml1.core.Statement stmt : assertion.getStatements()) {
  org.opensaml.saml1.core.Subject samlSubject = null;
  if (stmt instanceof org.opensaml.saml1.core.AttributeStatement) {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.wss4j

for (org.opensaml.saml1.core.Statement stmt : assertion.getStatements()) {
  org.opensaml.saml1.core.Subject samlSubject = null;
  if (stmt instanceof org.opensaml.saml1.core.AttributeStatement) {

相关文章