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