当前位置: 首页>>代码示例>>Java>>正文


Java AudienceRestrictionCondition类代码示例

本文整理汇总了Java中org.opensaml.saml1.core.AudienceRestrictionCondition的典型用法代码示例。如果您正苦于以下问题:Java AudienceRestrictionCondition类的具体用法?Java AudienceRestrictionCondition怎么用?Java AudienceRestrictionCondition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AudienceRestrictionCondition类属于org.opensaml.saml1.core包,在下文中一共展示了AudienceRestrictionCondition类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newConditions

import org.opensaml.saml1.core.AudienceRestrictionCondition; //导入依赖的package包/类
private Conditions newConditions(final DateTime issuedAt, final String serviceId) {
    final Conditions conditions = newSamlObject(Conditions.class);
    conditions.setNotBefore(issuedAt);
    conditions.setNotOnOrAfter(issuedAt.plus(this.issueLength));
    final AudienceRestrictionCondition audienceRestriction = newSamlObject(AudienceRestrictionCondition.class);
    final Audience audience = newSamlObject(Audience.class);
    audience.setUri(serviceId);
    audienceRestriction.getAudiences().add(audience);
    conditions.getAudienceRestrictionConditions().add(audienceRestriction);
    return conditions;
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:12,代码来源:Saml10SuccessResponseView.java

示例2: processChildElement

import org.opensaml.saml1.core.AudienceRestrictionCondition; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {

    AudienceRestrictionCondition audienceRestrictionCondition = (AudienceRestrictionCondition) parentSAMLObject;

    if (childSAMLObject instanceof Audience) {
        audienceRestrictionCondition.getAudiences().add((Audience) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:AudienceRestrictionConditionUnmarshaller.java

示例3: createSAMLAssertion

import org.opensaml.saml1.core.AudienceRestrictionCondition; //导入依赖的package包/类
@Override
public void createSAMLAssertion(DateTime notAfter, DateTime notBefore, String assertionId)
        throws IdentityProviderException {
    assertion = (Assertion) buildXMLObject(Assertion.DEFAULT_ELEMENT_NAME);
    Conditions conditions = (Conditions) buildXMLObject(Conditions.DEFAULT_ELEMENT_NAME);
    conditions.setNotBefore(notBefore);
    conditions.setNotOnOrAfter(notAfter);

    ServerConfiguration config = ServerConfiguration.getInstance();
    String host = "http://" + config.getFirstProperty("HostName");
    assertion.setIssuer(host);
    assertion.setIssueInstant(new DateTime());

    if (appilesTo != null) {
        Audience audience = (Audience) buildXMLObject(Audience.DEFAULT_ELEMENT_NAME);
        audience.setUri(appilesTo);
        AudienceRestrictionCondition audienceRestrictions =
                (AudienceRestrictionCondition) buildXMLObject(AudienceRestrictionCondition.DEFAULT_ELEMENT_NAME);
        audienceRestrictions.getAudiences().add(audience);

        conditions.getAudienceRestrictionConditions().add(audienceRestrictions);
    }

    assertion.setConditions(conditions);

    assertion.getAttributeStatements().add(this.attributeStmt);
    assertion.setID(assertionId);

}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:30,代码来源:SAML1TokenBuilder.java

示例4: populateRequiredData

import org.opensaml.saml1.core.AudienceRestrictionCondition; //导入依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
    super.populateRequiredData();
    
    AudienceRestrictionCondition audienceRestrictionCondition = (AudienceRestrictionCondition) target;
    QName name = new QName(SAMLConstants.SAML1_NS, Audience.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
    audienceRestrictionCondition.getAudiences().add((Audience)buildXMLObject(name));
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:9,代码来源:AudienceRestrictionConditionSchemaTest.java

示例5: validate

import org.opensaml.saml1.core.AudienceRestrictionCondition; //导入依赖的package包/类
/** {@inheritDoc} */
public void validate(AudienceRestrictionCondition audienceRestrictionCondition) throws ValidationException {
     validateAudiences(audienceRestrictionCondition);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:AudienceRestrictionConditionSchemaValidator.java

示例6: buildObject

import org.opensaml.saml1.core.AudienceRestrictionCondition; //导入依赖的package包/类
/** {@inheritDoc} */
public AudienceRestrictionCondition buildObject() {
    return buildObject(SAMLConstants.SAML1_NS, AudienceRestrictionCondition.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:AudienceRestrictionConditionBuilder.java

示例7: getAudienceRestrictionConditions

import org.opensaml.saml1.core.AudienceRestrictionCondition; //导入依赖的package包/类
/** {@inheritDoc} */
public List<AudienceRestrictionCondition> getAudienceRestrictionConditions() {
    QName qname = new QName(SAMLConstants.SAML1_NS, AudienceRestrictionCondition.DEFAULT_ELEMENT_LOCAL_NAME);
    return (List<AudienceRestrictionCondition>) conditions.subList(qname);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:ConditionsImpl.java

示例8: AudienceRestrictionConditionMarshaller

import org.opensaml.saml1.core.AudienceRestrictionCondition; //导入依赖的package包/类
/**
 * Constructor
 */
public AudienceRestrictionConditionMarshaller() {
    super(SAMLConstants.SAML1_NS, AudienceRestrictionCondition.DEFAULT_ELEMENT_LOCAL_NAME);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:7,代码来源:AudienceRestrictionConditionMarshaller.java

示例9: AudienceRestrictionConditionUnmarshaller

import org.opensaml.saml1.core.AudienceRestrictionCondition; //导入依赖的package包/类
/**
 * Constructor
 */
public AudienceRestrictionConditionUnmarshaller() {
    super(SAMLConstants.SAML1_NS, AudienceRestrictionCondition.DEFAULT_ELEMENT_LOCAL_NAME);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:7,代码来源:AudienceRestrictionConditionUnmarshaller.java

示例10: AudienceRestrictionConditionSchemaTest

import org.opensaml.saml1.core.AudienceRestrictionCondition; //导入依赖的package包/类
/** Constructor */
public AudienceRestrictionConditionSchemaTest() {
    super();
    targetQName = new QName(SAMLConstants.SAML1_NS, AudienceRestrictionCondition.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
    validator = new AudienceRestrictionConditionSchemaValidator();
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:7,代码来源:AudienceRestrictionConditionSchemaTest.java

示例11: testMissingAudience

import org.opensaml.saml1.core.AudienceRestrictionCondition; //导入依赖的package包/类
public void testMissingAudience(){
    AudienceRestrictionCondition audienceRestrictionCondition = (AudienceRestrictionCondition) target;
    audienceRestrictionCondition.getAudiences().clear();
    assertValidationFail("Audience was empty, should raise a Validation Exception");
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:6,代码来源:AudienceRestrictionConditionSchemaTest.java

示例12: testChildElementsMarshall

import org.opensaml.saml1.core.AudienceRestrictionCondition; //导入依赖的package包/类
/** {@inheritDoc} */
public void testChildElementsMarshall() {

    Conditions conditions = (Conditions) buildXMLObject(qname);

    QName arcQname = new QName(SAMLConstants.SAML1_NS, AudienceRestrictionCondition.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
    
    conditions.getConditions().add((AudienceRestrictionCondition) buildXMLObject(arcQname));
    conditions.getConditions().add((DoNotCacheCondition) buildXMLObject(new QName(SAMLConstants.SAML1_NS, DoNotCacheCondition.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX)));
    // conditions.addCondition(condition);

    conditions.getConditions().add((AudienceRestrictionCondition) buildXMLObject(arcQname));
    // conditions.addCondition(condition);
    //           
    conditions.getConditions().add((AudienceRestrictionCondition) buildXMLObject(arcQname));

    assertEquals(expectedChildElementsDOM, conditions);

}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:20,代码来源:ConditionsTest.java

示例13: AudienceRestrictionConditionTest

import org.opensaml.saml1.core.AudienceRestrictionCondition; //导入依赖的package包/类
/**
 * Constructor
 */
public AudienceRestrictionConditionTest() {
    singleElementFile = "/data/org/opensaml/saml1/impl/singleAudienceRestrictionCondition.xml";
    childElementsFile = "/data/org/opensaml/saml1/impl/AudienceRestrictionConditionWithChildren.xml";
    qname = new QName(SAMLConstants.SAML1_NS, AudienceRestrictionCondition.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:9,代码来源:AudienceRestrictionConditionTest.java

示例14: validateAudiences

import org.opensaml.saml1.core.AudienceRestrictionCondition; //导入依赖的package包/类
/**
 * Validates that the condition specifies at least one audience.
 * 
 * @param audienceRestrictionCondition condition to validate
 * 
 * @throws ValidationException thrown if now audience is specified in the condition
 */
protected void validateAudiences(AudienceRestrictionCondition audienceRestrictionCondition) throws ValidationException{
    if (audienceRestrictionCondition.getAudiences() == null || 
            audienceRestrictionCondition.getAudiences().size() == 0) {
            throw new ValidationException("No Audience statements present");
        }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:AudienceRestrictionConditionSchemaValidator.java


注:本文中的org.opensaml.saml1.core.AudienceRestrictionCondition类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。