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


Java Audience类代码示例

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


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

示例1: newConditions

import org.opensaml.saml1.core.Audience; //导入依赖的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.Audience; //导入依赖的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.Audience; //导入依赖的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.Audience; //导入依赖的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: populateRequiredData

import org.opensaml.saml1.core.Audience; //导入依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
    super.populateRequiredData();
    
    Audience audience = (Audience) target;
    audience.setUri("http://shibboleth.middleware.edu/");
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:8,代码来源:AudienceSpecTest.java

示例6: testMissingUri

import org.opensaml.saml1.core.Audience; //导入依赖的package包/类
public void testMissingUri(){
    Audience audience = (Audience) target;
    
    audience.setUri(null);
    assertValidationFail("Audience was null, should raise a Validation Exception");
    
    audience.setUri("");
    assertValidationFail("Audience was empty, should raise a Validation Exception");
    
    audience.setUri("   ");
    assertValidationFail("Audience was just spaces, should raise a Validation Exception");
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:13,代码来源:AudienceSpecTest.java

示例7: AudienceTest

import org.opensaml.saml1.core.Audience; //导入依赖的package包/类
/**
 * Constructor
 */
public AudienceTest() {
    super();
    singleElementFile = "/data/org/opensaml/saml1/impl/singleAudience.xml";
    singleElementOptionalAttributesFile = "/data/org/opensaml/saml1/impl/singleAudienceAttributes.xml";
    expectedUri = "urn:oasis:names:tc:SAML:1.0:assertion";
    qname = new QName(SAMLConstants.SAML1_NS, Audience.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:11,代码来源:AudienceTest.java

示例8: validate

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

示例9: validateURIPresent

import org.opensaml.saml1.core.Audience; //导入依赖的package包/类
protected void validateURIPresent(Audience audience) throws ValidationException {
    if (DatatypeHelper.isEmpty(audience.getUri())) {
        throw new ValidationException("AudienceURI Required");
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:AudienceSpecValidator.java

示例10: marshallElementContent

import org.opensaml.saml1.core.Audience; //导入依赖的package包/类
/** {@inheritDoc} */
protected void marshallElementContent(XMLObject samlObject, Element domElement) throws MarshallingException {
    Audience audience = (Audience) samlObject;

    XMLHelper.appendTextContent(domElement, audience.getUri());
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:AudienceMarshaller.java

示例11: processElementContent

import org.opensaml.saml1.core.Audience; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processElementContent(XMLObject samlObject, String elementContent) {
    Audience audience = (Audience) samlObject;
    audience.setUri(elementContent);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:AudienceUnmarshaller.java

示例12: getAudiences

import org.opensaml.saml1.core.Audience; //导入依赖的package包/类
/** {@inheritDoc} */
public List<Audience> getAudiences() {
    return audiences;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:AudienceRestrictionConditionImpl.java

示例13: buildObject

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

示例14: AudienceMarshaller

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

示例15: marshallElementContent

import org.opensaml.saml1.core.Audience; //导入依赖的package包/类
/** {@inheritDoc} */
protected void marshallElementContent(XMLObject samlObject, Element domElement) throws MarshallingException {
    Audience audience = (Audience) samlObject;

    XMLHelper.appendTextContent(domElement,audience.getUri());
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:7,代码来源:AudienceMarshaller.java


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