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


Java AuthenticationStatement.setAuthenticationInstant方法代码示例

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


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

示例1: newAuthenticationStatement

import org.opensaml.saml1.core.AuthenticationStatement; //导入方法依赖的package包/类
private AuthenticationStatement newAuthenticationStatement(final Authentication authentication) {
    final String authenticationMethod = (String) authentication.getAttributes().get(
            SamlAuthenticationMetaDataPopulator.ATTRIBUTE_AUTHENTICATION_METHOD);
    final AuthenticationStatement authnStatement = newSamlObject(AuthenticationStatement.class);
    authnStatement.setAuthenticationInstant(new DateTime(authentication.getAuthenticatedDate()));
    authnStatement.setAuthenticationMethod(
            authenticationMethod != null
            ? authenticationMethod
                    : SamlAuthenticationMetaDataPopulator.AUTHN_METHOD_UNSPECIFIED);
    authnStatement.setSubject(newSubject(authentication.getPrincipal().getId()));
    return authnStatement;
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:13,代码来源:Saml10SuccessResponseView.java

示例2: processAttribute

import org.opensaml.saml1.core.AuthenticationStatement; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
    AuthenticationStatement authenticationStatement = (AuthenticationStatement) samlObject;

    if (AuthenticationStatement.AUTHENTICATIONINSTANT_ATTRIB_NAME.equals(attribute.getLocalName())
            && !DatatypeHelper.isEmpty(attribute.getValue())) {
        DateTime value = new DateTime(attribute.getValue(), ISOChronology.getInstanceUTC());
        authenticationStatement.setAuthenticationInstant(value);
    } else if (AuthenticationStatement.AUTHENTICATIONMETHOD_ATTRIB_NAME.equals(attribute.getLocalName())) {
        authenticationStatement.setAuthenticationMethod(attribute.getValue());
    } else {
        super.processAttribute(samlObject, attribute);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:AuthenticationStatementUnmarshaller.java

示例3: populateRequiredData

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

    AuthenticationStatement authenticationStatement = (AuthenticationStatement) target;
    authenticationStatement.setAuthenticationInstant(new DateTime());
    authenticationStatement.setAuthenticationMethod("Hi there!");
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:9,代码来源:AuthenticationStatementSchemaTest.java

示例4: testSingleElementOptionalAttributesMarshall

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

    public void testSingleElementOptionalAttributesMarshall() {
        AuthenticationStatement authenticationStatement = (AuthenticationStatement) buildXMLObject(qname);

        authenticationStatement.setAuthenticationInstant(expectedAuthenticationInstant);
        authenticationStatement.setAuthenticationMethod(expectedAuthenticationMethod);
        assertEquals(expectedOptionalAttributesDOM, authenticationStatement);
    }
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:10,代码来源:AuthenticationStatementTest.java

示例5: testMissingAuthenticationInstant

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

    authenticationStatement.setAuthenticationInstant(null);
    assertValidationFail("No AuthenticationInstant attribute - should fail");
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:7,代码来源:AuthenticationStatementSchemaTest.java


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