本文整理汇总了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;
}
示例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);
}
}
示例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));
}
示例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");
}
示例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");
}
示例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);
}
示例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);
}
}