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

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

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

Assertion.setConditions介绍

[英]Sets the Conditions placed on this assertion.
[中]设置放置在此断言上的条件。

代码示例

代码示例来源:origin: line/armeria

conditions.getAudienceRestrictions().add(audienceRestriction);
assertion.setConditions(conditions);

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

/**
 * Creates and adds a {@link Conditions} to a given {@link Assertion}. If the {@link Assertion} already contains an
 * {@link Conditions} this method just returns.
 * 
 * @param action current action
 * @param assertion assertion to which the condition will be added
 * 
 * @return the {@link Conditions} that already existed on, or the one that was added to, the {@link Assertion}
 */
@Nonnull public static Conditions addConditionsToAssertion(@Nonnull final AbstractProfileAction action,
    @Nonnull final Assertion assertion) {
  Conditions conditions = assertion.getConditions();
  if (conditions == null) {
    final SAMLObjectBuilder<Conditions> conditionsBuilder = (SAMLObjectBuilder<Conditions>)
        XMLObjectProviderRegistrySupport.getBuilderFactory().<Conditions>getBuilderOrThrow(
            Conditions.DEFAULT_ELEMENT_NAME);
    conditions = conditionsBuilder.buildObject();
    assertion.setConditions(conditions);
    getLogger().debug("Profile Action {}: Assertion {} did not already contain Conditions, one was added",
        action.getClass().getSimpleName(), assertion.getID());
  } else {
    getLogger().debug("Profile Action {}: Assertion {} already contained Conditions, nothing was done",
        action.getClass().getSimpleName(), assertion.getID());
  }
  return conditions;
}

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

/** {@inheritDoc} */
protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
  Assertion assertion = (Assertion) parentObject;
  if (childObject instanceof Issuer) {
    assertion.setIssuer((Issuer) childObject);
  } else if (childObject instanceof Signature) {
    assertion.setSignature((Signature) childObject);
  } else if (childObject instanceof Subject) {
    assertion.setSubject((Subject) childObject);
  } else if (childObject instanceof Conditions) {
    assertion.setConditions((Conditions) childObject);
  } else if (childObject instanceof Advice) {
    assertion.setAdvice((Advice) childObject);
  } else if (childObject instanceof Statement) {
    assertion.getStatements().add((Statement) childObject);
  } else {
    super.processChildElement(parentObject, childObject);
  }
}

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

private void createNewConditions(SamlAssertionWrapper assertion, TokenRenewerParameters tokenParameters) {
  ConditionsBean conditions =
    conditionsProvider.getConditions(convertToProviderParameters(tokenParameters));
  if (assertion.getSaml1() != null) {
    org.opensaml.saml.saml1.core.Assertion saml1Assertion = assertion.getSaml1();
    saml1Assertion.setIssueInstant(new DateTime());
    org.opensaml.saml.saml1.core.Conditions saml1Conditions =
      SAML1ComponentBuilder.createSamlv1Conditions(conditions);
    saml1Assertion.setConditions(saml1Conditions);
  } else {
    org.opensaml.saml.saml2.core.Assertion saml2Assertion = assertion.getSaml2();
    saml2Assertion.setIssueInstant(new DateTime());
    org.opensaml.saml.saml2.core.Conditions saml2Conditions =
      SAML2ComponentBuilder.createConditions(conditions);
    saml2Assertion.setConditions(saml2Conditions);
  }
}

代码示例来源:origin: org.apache.cxf.services.sts/cxf-services-sts-core

private void createNewConditions(SamlAssertionWrapper assertion, TokenRenewerParameters tokenParameters) {
  ConditionsBean conditions =
    conditionsProvider.getConditions(convertToProviderParameters(tokenParameters));
  if (assertion.getSaml1() != null) {
    org.opensaml.saml.saml1.core.Assertion saml1Assertion = assertion.getSaml1();
    saml1Assertion.setIssueInstant(new DateTime());
    org.opensaml.saml.saml1.core.Conditions saml1Conditions =
      SAML1ComponentBuilder.createSamlv1Conditions(conditions);
    saml1Assertion.setConditions(saml1Conditions);
  } else {
    org.opensaml.saml.saml2.core.Assertion saml2Assertion = assertion.getSaml2();
    saml2Assertion.setIssueInstant(new DateTime());
    org.opensaml.saml.saml2.core.Conditions saml2Conditions =
      SAML2ComponentBuilder.createConditions(conditions);
    saml2Assertion.setConditions(saml2Conditions);
  }
}

代码示例来源:origin: org.apereo.cas/cas-server-support-saml-idp-web

assertion.setSubject(this.samlProfileSamlSubjectBuilder.build(authnRequest, request, response,
  casAssertion, service, adaptor, binding, messageContext));
assertion.setConditions(this.samlProfileSamlConditionsBuilder.build(authnRequest,
  request, response, casAssertion, service, adaptor, binding, messageContext));
signAssertion(assertion, request, response, service, adaptor, binding, authnRequest);

代码示例来源:origin: org.apereo.cas/cas-server-support-saml-googleapps-core

assertion.setConditions(conditions);

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

saml2.setConditions(conditions);

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.saml2/org.wso2.carbon.identity.query.saml

conditions.setNotOnOrAfter(notOnOrAfter);
conditions.getAudienceRestrictions().add(audienceRestriction);
samlAssertion.setConditions(conditions);

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.saml2/org.wso2.carbon.identity.query.saml

conditions.setNotOnOrAfter(notOnOrAfter);
conditions.getAudienceRestrictions().add(audienceRestriction);
samlAssertion.setConditions(conditions);

代码示例来源:origin: spring-projects/spring-security-saml

conditions.setNotBefore(request.getConditions().getNotBefore());
conditions.setNotOnOrAfter(request.getConditions().getNotOnOrAfter());
a.setConditions(conditions);

相关文章