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


Java AuthenticationBuilder.addAttribute方法代码示例

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


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

示例1: MockTicketGrantingTicket

import org.jasig.cas.authentication.AuthenticationBuilder; //导入方法依赖的package包/类
MockTicketGrantingTicket(final String id, final Credential credential, final Map<String, Object> principalAttributes) {
    this.id = id;
    final CredentialMetaData credentialMetaData = new BasicCredentialMetaData(credential);
    final AuthenticationBuilder builder = new DefaultAuthenticationBuilder();
    builder.setPrincipal(this.principalFactory.createPrincipal(USERNAME, principalAttributes));
    builder.setAuthenticationDate(new DateTime());
    builder.addCredential(credentialMetaData);
    builder.addAttribute(RememberMeCredential.AUTHENTICATION_ATTRIBUTE_REMEMBER_ME, Boolean.TRUE);
    final AuthenticationHandler handler = new MockAuthenticationHandler();
    try {
        builder.addSuccess(handler.getName(), handler.authenticate(credential));
    } catch (final Exception e) {
        throw new RuntimeException(e);
    }
    builder.addFailure(handler.getName(), FailedLoginException.class);
    this.authentication = builder.build();
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:18,代码来源:KryoTranscoderTests.java

示例2: populateAttributes

import org.jasig.cas.authentication.AuthenticationBuilder; //导入方法依赖的package包/类
@Override
public void populateAttributes(final AuthenticationBuilder authenticationBuilder, final Credential credential) {
    final RequestContext context = RequestContextHolder.getRequestContext();
    if (context != null) {
        final Service svc = WebUtils.getService(context);

        if (svc instanceof MultiFactorAuthenticationSupportingWebApplicationService) {
            final MultiFactorAuthenticationSupportingWebApplicationService mfaSvc =
                    (MultiFactorAuthenticationSupportingWebApplicationService) svc;

            authenticationBuilder.addAttribute(
                    MultiFactorAuthenticationSupportingWebApplicationService.CONST_PARAM_AUTHN_METHOD,
                    mfaSvc.getAuthenticationMethod());

            logger.debug("Captured authentication method [{}] into the authentication context",
                    mfaSvc.getAuthenticationMethod());
        }
    }
}
 
开发者ID:Unicon,项目名称:cas-mfa,代码行数:20,代码来源:RememberAuthenticationMethodMetaDataPopulator.java

示例3: populateAttributes

import org.jasig.cas.authentication.AuthenticationBuilder; //导入方法依赖的package包/类
@Override
public void populateAttributes(final AuthenticationBuilder builder, final Credential credential) {
    final RememberMeCredential r = (RememberMeCredential) credential;
    if (r.isRememberMe()) {
        LOGGER.debug("Credential is configured to be remembered. Captured this as {} attribute",
                RememberMeCredential.AUTHENTICATION_ATTRIBUTE_REMEMBER_ME);
        builder.addAttribute(RememberMeCredential.AUTHENTICATION_ATTRIBUTE_REMEMBER_ME, Boolean.TRUE);
    }
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:10,代码来源:RememberMeAuthenticationMetaDataPopulator.java

示例4: populateAttributes

import org.jasig.cas.authentication.AuthenticationBuilder; //导入方法依赖的package包/类
@Override
public final void populateAttributes(final AuthenticationBuilder builder, final Credential credential) {

    final String credentialsClass = credential.getClass().getName();
    final String authenticationMethod = this.authenticationMethods.get(credentialsClass);

    builder.addAttribute(ATTRIBUTE_AUTHENTICATION_METHOD, authenticationMethod);
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:9,代码来源:SamlAuthenticationMetaDataPopulator.java

示例5: populateAttributes

import org.jasig.cas.authentication.AuthenticationBuilder; //导入方法依赖的package包/类
@Override
public void populateAttributes(final AuthenticationBuilder builder, final Credential credential) {
    final RememberMeCredential r = (RememberMeCredential) credential;
    if (r.isRememberMe()) {
        builder.addAttribute(RememberMeCredential.AUTHENTICATION_ATTRIBUTE_REMEMBER_ME, Boolean.TRUE);
    }
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:8,代码来源:RememberMeAuthenticationMetaDataPopulator.java

示例6: populateAttributes

import org.jasig.cas.authentication.AuthenticationBuilder; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void populateAttributes(final AuthenticationBuilder builder, final Credential credential) {
    if (credential instanceof ClientCredential) {
        final ClientCredential clientCredential = (ClientCredential) credential;
        builder.addAttribute(CLIENT_NAME, clientCredential.getCredentials().getClientName());
    }
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:11,代码来源:ClientAuthenticationMetaDataPopulator.java

示例7: populateAttributes

import org.jasig.cas.authentication.AuthenticationBuilder; //导入方法依赖的package包/类
public void populateAttributes(final AuthenticationBuilder builder, final Credential credential) {
    if (credential instanceof RememberMeCredential) {
        final RememberMeCredential r = (RememberMeCredential) credential;
        if (r.isRememberMe()) {
            builder.addAttribute(RememberMeCredential.AUTHENTICATION_ATTRIBUTE_REMEMBER_ME, true);
        }
    }
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:9,代码来源:RememberMeAuthenticationMetaDataPopulator.java

示例8: populateAttributes

import org.jasig.cas.authentication.AuthenticationBuilder; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void populateAttributes(final AuthenticationBuilder builder, final Credential credential) {
	if (credential instanceof ClientCredential) {
		final ClientCredential clientCredential = (ClientCredential) credential;
		builder.addAttribute(CLIENT_NAME, clientCredential.getOpenIdCredentials().getClientName());
	}
}
 
开发者ID:AgarwalNeha1,项目名称:gluu,代码行数:11,代码来源:ClientAuthenticationMetaDataPopulator.java

示例9: populateAttributes

import org.jasig.cas.authentication.AuthenticationBuilder; //导入方法依赖的package包/类
/**
 * {@InheritDoc}
 */
@Override
public void populateAttributes(final AuthenticationBuilder builder, final Credential credential) {
	if (credential instanceof ClientCredential) {
		final ClientCredential clientCredential = (ClientCredential) credential;
		builder.addAttribute(CLIENT_NAME, clientCredential.getOpenIdCredentials().getClientName());
	}
}
 
开发者ID:GluuFederation,项目名称:oxTrust,代码行数:11,代码来源:ClientAuthenticationMetaDataPopulator.java

示例10: populateAttributes

import org.jasig.cas.authentication.AuthenticationBuilder; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void populateAttributes(final AuthenticationBuilder builder, final Credential credential) {
    final ClientCredential clientCredential = (ClientCredential) credential;
    builder.addAttribute(CLIENT_NAME, clientCredential.getCredentials().getClientName());
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:9,代码来源:ClientAuthenticationMetaDataPopulator.java


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