Search in sources :

Example 1 with WsFederationAuthenticationHandler

use of org.apereo.cas.support.wsfederation.authentication.handler.support.WsFederationAuthenticationHandler in project cas by apereo.

the class WsFedAuthenticationEventExecutionPlanConfiguration method wsfedAuthenticationEventExecutionPlanConfigurer.

@ConditionalOnMissingBean(name = "wsfedAuthenticationEventExecutionPlanConfigurer")
@Bean
public AuthenticationEventExecutionPlanConfigurer wsfedAuthenticationEventExecutionPlanConfigurer() {
    return plan -> casProperties.getAuthn().getWsfed().stream().filter(wsfed -> StringUtils.isNotBlank(wsfed.getIdentityProviderUrl()) && StringUtils.isNotBlank(wsfed.getIdentityProviderIdentifier())).forEach(wsfed -> {
        final AuthenticationHandler handler = new WsFederationAuthenticationHandler(wsfed.getName(), servicesManager, adfsPrincipalFactory());
        if (!wsfed.isAttributeResolverEnabled()) {
            plan.registerAuthenticationHandler(handler);
        } else {
            final WsFederationCredentialsToPrincipalResolver r = new WsFederationCredentialsToPrincipalResolver(attributeRepository, adfsPrincipalFactory(), wsfed.getPrincipal().isReturnNull(), wsfed.getPrincipal().getPrincipalAttribute(), getWsFederationConfiguration(wsfed));
            plan.registerAuthenticationHandlerWithPrincipalResolver(handler, r);
        }
    });
}
Also used : CasConfigurationProperties(org.apereo.cas.configuration.CasConfigurationProperties) WsFederationAttributeMutator(org.apereo.cas.support.wsfederation.WsFederationAttributeMutator) Autowired(org.springframework.beans.factory.annotation.Autowired) Beans(org.apereo.cas.configuration.support.Beans) StringUtils(org.apache.commons.lang3.StringUtils) IPersonAttributeDao(org.apereo.services.persondir.IPersonAttributeDao) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) HashSet(java.util.HashSet) AuthenticationHandler(org.apereo.cas.authentication.AuthenticationHandler) PrincipalFactory(org.apereo.cas.authentication.principal.PrincipalFactory) WsFederationCookieCipherExecutor(org.apereo.cas.support.wsfederation.web.WsFederationCookieCipherExecutor) DefaultCasCookieValueManager(org.apereo.cas.web.support.DefaultCasCookieValueManager) EncryptionJwtSigningJwtCryptographyProperties(org.apereo.cas.configuration.model.core.util.EncryptionJwtSigningJwtCryptographyProperties) WsFederationAuthenticationHandler(org.apereo.cas.support.wsfederation.authentication.handler.support.WsFederationAuthenticationHandler) WsFederationDelegatedCookieProperties(org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegatedCookieProperties) EnableConfigurationProperties(org.springframework.boot.context.properties.EnableConfigurationProperties) Qualifier(org.springframework.beans.factory.annotation.Qualifier) WsFederationCookieGenerator(org.apereo.cas.support.wsfederation.web.WsFederationCookieGenerator) WsFederationConfiguration(org.apereo.cas.support.wsfederation.WsFederationConfiguration) ServicesManager(org.apereo.cas.services.ServicesManager) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ResourceLoader(org.springframework.core.io.ResourceLoader) WsFederationDelegationProperties(org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties) Collection(java.util.Collection) CipherExecutor(org.apereo.cas.CipherExecutor) Configuration(org.springframework.context.annotation.Configuration) Slf4j(lombok.extern.slf4j.Slf4j) WsFederationCredentialsToPrincipalResolver(org.apereo.cas.support.wsfederation.authentication.principal.WsFederationCredentialsToPrincipalResolver) Bean(org.springframework.context.annotation.Bean) AuthenticationEventExecutionPlanConfigurer(org.apereo.cas.authentication.AuthenticationEventExecutionPlanConfigurer) DefaultPrincipalFactory(org.apereo.cas.authentication.principal.DefaultPrincipalFactory) AuthenticationHandler(org.apereo.cas.authentication.AuthenticationHandler) WsFederationAuthenticationHandler(org.apereo.cas.support.wsfederation.authentication.handler.support.WsFederationAuthenticationHandler) WsFederationAuthenticationHandler(org.apereo.cas.support.wsfederation.authentication.handler.support.WsFederationAuthenticationHandler) WsFederationCredentialsToPrincipalResolver(org.apereo.cas.support.wsfederation.authentication.principal.WsFederationCredentialsToPrincipalResolver) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

Collection (java.util.Collection)1 HashSet (java.util.HashSet)1 Slf4j (lombok.extern.slf4j.Slf4j)1 StringUtils (org.apache.commons.lang3.StringUtils)1 CipherExecutor (org.apereo.cas.CipherExecutor)1 AuthenticationEventExecutionPlanConfigurer (org.apereo.cas.authentication.AuthenticationEventExecutionPlanConfigurer)1 AuthenticationHandler (org.apereo.cas.authentication.AuthenticationHandler)1 DefaultPrincipalFactory (org.apereo.cas.authentication.principal.DefaultPrincipalFactory)1 PrincipalFactory (org.apereo.cas.authentication.principal.PrincipalFactory)1 CasConfigurationProperties (org.apereo.cas.configuration.CasConfigurationProperties)1 EncryptionJwtSigningJwtCryptographyProperties (org.apereo.cas.configuration.model.core.util.EncryptionJwtSigningJwtCryptographyProperties)1 WsFederationDelegatedCookieProperties (org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegatedCookieProperties)1 WsFederationDelegationProperties (org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties)1 Beans (org.apereo.cas.configuration.support.Beans)1 ServicesManager (org.apereo.cas.services.ServicesManager)1 WsFederationAttributeMutator (org.apereo.cas.support.wsfederation.WsFederationAttributeMutator)1 WsFederationConfiguration (org.apereo.cas.support.wsfederation.WsFederationConfiguration)1 WsFederationAuthenticationHandler (org.apereo.cas.support.wsfederation.authentication.handler.support.WsFederationAuthenticationHandler)1 WsFederationCredentialsToPrincipalResolver (org.apereo.cas.support.wsfederation.authentication.principal.WsFederationCredentialsToPrincipalResolver)1 WsFederationCookieCipherExecutor (org.apereo.cas.support.wsfederation.web.WsFederationCookieCipherExecutor)1