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


Java AuthnStatement.setSubjectLocality方法代码示例

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


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

示例1: processChildElement

import org.opensaml.saml2.core.AuthnStatement; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
    AuthnStatement authnStatement = (AuthnStatement) parentObject;
    if (childObject instanceof SubjectLocality) {
        authnStatement.setSubjectLocality((SubjectLocality) childObject);
    } else if (childObject instanceof AuthnContext) {
        authnStatement.setAuthnContext((AuthnContext) childObject);
    } else {
        super.processChildElement(parentObject, childObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:AuthnStatementUnmarshaller.java

示例2: testChildElementsMarshall

import org.opensaml.saml2.core.AuthnStatement; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void testChildElementsMarshall() {
    QName qname = new QName(SAMLConstants.SAML20_NS, AuthnStatement.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20_PREFIX);
    AuthnStatement authnStatement = (AuthnStatement) buildXMLObject(qname);

    QName subjectLocalityQName = new QName(SAMLConstants.SAML20_NS, SubjectLocality.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20_PREFIX);
    authnStatement.setSubjectLocality((SubjectLocality) buildXMLObject(subjectLocalityQName));
    
    QName authnContextQName = new QName(SAMLConstants.SAML20_NS, AuthnContext.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20_PREFIX);
    authnStatement.setAuthnContext((AuthnContext) buildXMLObject(authnContextQName));
    
    assertEquals(expectedChildElementsDOM, authnStatement);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:14,代码来源:AuthnStatementTest.java

示例3: createAuthnStatement

import org.opensaml.saml2.core.AuthnStatement; //导入方法依赖的package包/类
private static AuthnStatement createAuthnStatement() {
	AuthnStatement authnStatement = null;
	AuthnContext authnContext = null;
	SubjectLocality subjectLocality = null;
	if (samlResponseData.getAuthnContextClassRef() != null
			&& samlResponseData.getAuthnContextClassRef().length() > 0) {
		authnContext = create(AuthnContext.DEFAULT_ELEMENT_NAME);

		AuthnContextClassRef authnContextClassRef = create(AuthnContextClassRef.DEFAULT_ELEMENT_NAME);
		if (samlResponseData.getAuthnContextClassRef().equals(
				SamlResponseData.REPLACE_WITH_AUTHN_REQUEST)) {
			authnContextClassRef.setAuthnContextClassRef(authnRequest
					.getRequestedAuthnContext().getAuthnContextClassRefs()
					.get(0).getAuthnContextClassRef());
		} else {
			authnContextClassRef.setAuthnContextClassRef(samlResponseData
					.getAuthnContextClassRef());
		}
		authnContext.setAuthnContextClassRef(authnContextClassRef);
	}

	if (samlResponseData.getSubjectLocalityAddress() != null
			&& samlResponseData.getSubjectLocalityAddress().length() > 0) {
		subjectLocality = create(SubjectLocality.DEFAULT_ELEMENT_NAME);
		subjectLocality.setAddress(samlResponseData
				.getSubjectLocalityAddress());
	}

	if (samlResponseData.getSubjectLocalityDNSName() != null
			&& samlResponseData.getSubjectLocalityDNSName().length() > 0) {

		if (subjectLocality == null)
			subjectLocality = create(SubjectLocality.DEFAULT_ELEMENT_NAME);
		subjectLocality.setDNSName(samlResponseData
				.getSubjectLocalityDNSName());
	}

	if (authnContext != null || subjectLocality != null
			|| samlResponseData.getAuthnInstant() != null) {
		authnStatement = create(AuthnStatement.DEFAULT_ELEMENT_NAME);
		if (samlResponseData.getAuthnInstant() != null) {
			authnStatement.setAuthnInstant(startTime
					.plusMinutes(samlResponseData.getAuthnInstant()));
		}
		authnStatement.setSessionIndex(GENERATOR.generateIdentifier());
		authnStatement.setAuthnContext(authnContext);
		authnStatement.setSubjectLocality(subjectLocality);
	}

	return authnStatement;
}
 
开发者ID:vetsin,项目名称:SamlSnort,代码行数:52,代码来源:SamlTool.java


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