Java Code Examples for org.jasig.cas.authentication.AuthenticationBuilder#addAttribute()

The following examples show how to use org.jasig.cas.authentication.AuthenticationBuilder#addAttribute() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RememberAuthenticationMethodMetaDataPopulator.java    From cas-mfa with Apache License 2.0 6 votes vote down vote up
@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());
        }
    }
}
 
Example 2
Source File: SamlAuthenticationMetaDataPopulator.java    From springboot-shiro-cas-mybatis with MIT License 5 votes vote down vote up
@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);
}
 
Example 3
Source File: RememberMeAuthenticationMetaDataPopulator.java    From springboot-shiro-cas-mybatis with MIT License 5 votes vote down vote up
@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);
    }
}
 
Example 4
Source File: SamlAuthenticationMetaDataPopulator.java    From cas4.0.x-server-wechat with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example 5
Source File: ClientAuthenticationMetaDataPopulator.java    From cas4.0.x-server-wechat with Apache License 2.0 5 votes vote down vote up
/**
 * {@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());
    }
}
 
Example 6
Source File: RememberMeAuthenticationMetaDataPopulator.java    From cas4.0.x-server-wechat with Apache License 2.0 5 votes vote down vote up
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);
        }
    }
}
 
Example 7
Source File: ClientAuthenticationMetaDataPopulator.java    From oxTrust with MIT License 5 votes vote down vote up
/**
 * {@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());
	}
}
 
Example 8
Source File: ClientAuthenticationMetaDataPopulator.java    From springboot-shiro-cas-mybatis with MIT License 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void populateAttributes(final AuthenticationBuilder builder, final Credential credential) {
    final ClientCredential clientCredential = (ClientCredential) credential;
    builder.addAttribute(CLIENT_NAME, clientCredential.getCredentials().getClientName());
}