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

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

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

Assertion.getVersion介绍

[英]Gets the SAML Version of this assertion.
[中]获取此断言的SAML版本。

代码示例

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

/**
 * Checks that the Version attribute is present.
 * 
 * @param assertion
 * @throws ValidationException
 */
protected void validateVersion(Assertion assertion) throws ValidationException {
  if (assertion.getVersion() == null) {
    throw new ValidationException("Version is required attribute");
  }
}

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

/** {@inheritDoc} */
  protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
    Assertion assertion = (Assertion) samlObject;

    if (assertion.getVersion() != null) {
      domElement.setAttributeNS(null, Assertion.VERSION_ATTRIB_NAME, assertion.getVersion().toString());
    }

    if (assertion.getIssueInstant() != null) {
      String issueInstantStr = Configuration.getSAMLDateFormatter().print(assertion.getIssueInstant());
      domElement.setAttributeNS(null, Assertion.ISSUE_INSTANT_ATTRIB_NAME, issueInstantStr);
    }

    if (assertion.getID() != null) {
      domElement.setAttributeNS(null, Assertion.ID_ATTRIB_NAME, assertion.getID());
      domElement.setIdAttributeNS(null, Assertion.ID_ATTRIB_NAME, true);
    }
  }
}

代码示例来源:origin: usnistgov/iheos-toolkit2

if (oElement.getVersion() != null) {
  oSamlEvidAssert.setVersion(oElement.getVersion().toString());
  log.debug("Assertion.SamlAuthzDecisionStatement.Evidence.Assertion.Version = " + oSamlEvidAssert.getVersion());

相关文章