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


Java Subject.setSubjectConfirmation方法代码示例

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


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

示例1: newSubject

import org.opensaml.saml1.core.Subject; //导入方法依赖的package包/类
private Subject newSubject(final String identifier) {
    final SubjectConfirmation confirmation = newSamlObject(SubjectConfirmation.class);
    final ConfirmationMethod method = newSamlObject(ConfirmationMethod.class);
    method.setConfirmationMethod(CONFIRMATION_METHOD);
    confirmation.getConfirmationMethods().add(method);
    final NameIdentifier nameIdentifier = newSamlObject(NameIdentifier.class);
    nameIdentifier.setNameIdentifier(identifier);
    final Subject subject = newSamlObject(Subject.class);
    subject.setNameIdentifier(nameIdentifier);
    subject.setSubjectConfirmation(confirmation);
    return subject;
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:13,代码来源:Saml10SuccessResponseView.java

示例2: processChildElement

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

    Subject subject = (Subject) parentSAMLObject;

    if (childSAMLObject instanceof NameIdentifier) {
        subject.setNameIdentifier((NameIdentifier) childSAMLObject);
    } else if (childSAMLObject instanceof SubjectConfirmation) {
        subject.setSubjectConfirmation((SubjectConfirmation) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:SubjectUnmarshaller.java

示例3: populateRequiredData

import org.opensaml.saml1.core.Subject; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
    super.populateRequiredData();

    Subject subject = (Subject) target;
    
    QName qname = new QName(SAMLConstants.SAML1_NS, NameIdentifier.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
    subject.setNameIdentifier((NameIdentifier)buildXMLObject(qname));
    qname = new QName(SAMLConstants.SAML1_NS, SubjectConfirmation.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
    subject.setSubjectConfirmation((SubjectConfirmation)buildXMLObject(qname));
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:12,代码来源:SubjectSchemaTest.java

示例4: testMissingNameId

import org.opensaml.saml1.core.Subject; //导入方法依赖的package包/类
public void testMissingNameId(){
    Subject subject = (Subject) target;

    subject.setNameIdentifier(null);
    assertValidationPass("No NameIdenitifer, but SubjectConfirmation still present, should be valid");
    subject.setSubjectConfirmation(null);
    assertValidationFail("No NameIdenitifer and no SubjectConfirmation");
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:9,代码来源:SubjectSchemaTest.java

示例5: testMissingSubjectConf

import org.opensaml.saml1.core.Subject; //导入方法依赖的package包/类
public void testMissingSubjectConf(){
    Subject subject = (Subject) target;

    subject.setSubjectConfirmation(null);
    assertValidationPass("No SubjectConfirmation, but NameIdenitifer still present, should be valid");
    subject.setNameIdentifier(null);
    assertValidationFail("No NameIdenitifer and no SubjectConfirmation");
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:9,代码来源:SubjectSchemaTest.java

示例6: testChildElementsMarshall

import org.opensaml.saml1.core.Subject; //导入方法依赖的package包/类
/** {@inheritDoc} */

    public void testChildElementsMarshall() {
        Subject subject = (Subject) buildXMLObject(qname);

        QName oqname = new QName(SAMLConstants.SAML1_NS, NameIdentifier.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
        subject.setNameIdentifier((NameIdentifier) buildXMLObject(oqname));
        oqname = new QName(SAMLConstants.SAML1_NS, SubjectConfirmation.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
        subject.setSubjectConfirmation((SubjectConfirmation) buildXMLObject(oqname));

        assertEquals(expectedChildElementsDOM, subject);
    }
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:13,代码来源:SubjectTest.java

示例7: createStatement

import org.opensaml.saml1.core.Subject; //导入方法依赖的package包/类
@Override
public void createStatement(GenericIdentityProviderData ipData, RahasData rahasData)
        throws IdentityProviderException {
    if (log.isDebugEnabled()) {
        log.debug("Begin SAML statement creation.");
    }
    attributeStmt = (AttributeStatement) buildXMLObject(AttributeStatement.DEFAULT_ELEMENT_NAME);

    Subject subject = (Subject) buildXMLObject(Subject.DEFAULT_ELEMENT_NAME);
    SubjectConfirmation subjectConf =
            (SubjectConfirmation) buildXMLObject(SubjectConfirmation.DEFAULT_ELEMENT_NAME);
    ConfirmationMethod confMethod = (ConfirmationMethod) buildXMLObject(ConfirmationMethod.DEFAULT_ELEMENT_NAME);
    confMethod.setConfirmationMethod(CONF_KEY);
    subjectConf.getConfirmationMethods().add(confMethod);
    subject.setSubjectConfirmation(subjectConf);

    attributeStmt.setSubject(subject);

    Map<String, RequestedClaimData> mapClaims = ipData.getRequestedClaims();

    if (rahasData.getAppliesToAddress() != null) {
        appilesTo = rahasData.getAppliesToAddress();
    }

    Iterator<RequestedClaimData> ite = mapClaims.values().iterator();

    while (ite.hasNext()) {
        RequestedClaimData claim = ite.next();
        String uri = claim.getUri();

        int index = uri.lastIndexOf("/");
        String attrName = uri.substring(index + 1, uri.length());
        String attrNamespace = uri.substring(0, index);

        Attribute attribute = (Attribute) buildXMLObject(Attribute.DEFAULT_ELEMENT_NAME);
        attribute.setAttributeName(attrName);
        attribute.setAttributeNamespace(attrNamespace);

        XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();
        XSStringBuilder attributeValueBuilder = (XSStringBuilder) builderFactory.getBuilder(XSString.TYPE_NAME);

        XSString stringValue =
                attributeValueBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME);
        stringValue.setValue(claim.getValue());
        attribute.getAttributeValues().add(stringValue);

        attributeStmt.getAttributes().add(attribute);
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:50,代码来源:SAML1TokenBuilder.java


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