Search in sources :

Example 1 with WsFederationDelegationProperties

use of org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties in project cas by apereo.

the class WsFedAuthenticationEventExecutionPlanConfiguration method adfsPrincipalResolver.

@Bean
@RefreshScope
public PrincipalResolver adfsPrincipalResolver() {
    final WsFederationDelegationProperties wsfed = casProperties.getAuthn().getWsfed();
    final WsFederationCredentialsToPrincipalResolver r = new WsFederationCredentialsToPrincipalResolver();
    r.setConfiguration(wsFedConfig());
    r.setAttributeRepository(attributeRepository);
    r.setPrincipalAttributeName(wsfed.getPrincipal().getPrincipalAttribute());
    r.setReturnNullIfNoAttributes(wsfed.getPrincipal().isReturnNull());
    r.setPrincipalFactory(adfsPrincipalFactory());
    return r;
}
Also used : WsFederationDelegationProperties(org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties) WsFederationCredentialsToPrincipalResolver(org.apereo.cas.support.wsfederation.authentication.principal.WsFederationCredentialsToPrincipalResolver) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with WsFederationDelegationProperties

use of org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties in project cas by apereo.

the class WsFedAuthenticationEventExecutionPlanConfiguration method wsFedConfig.

@Bean
@RefreshScope
public WsFederationConfiguration wsFedConfig() {
    final WsFederationConfiguration config = new WsFederationConfiguration();
    final WsFederationDelegationProperties wsfed = casProperties.getAuthn().getWsfed();
    config.setAttributesType(WsFederationConfiguration.WsFedPrincipalResolutionAttributesType.valueOf(wsfed.getAttributesType()));
    config.setIdentityAttribute(wsfed.getIdentityAttribute());
    config.setIdentityProviderIdentifier(wsfed.getIdentityProviderIdentifier());
    config.setIdentityProviderUrl(wsfed.getIdentityProviderUrl());
    config.setTolerance(wsfed.getTolerance());
    config.setRelyingPartyIdentifier(wsfed.getRelyingPartyIdentifier());
    org.springframework.util.StringUtils.commaDelimitedListToSet(wsfed.getSigningCertificateResources()).forEach(s -> config.getSigningCertificateResources().add(this.resourceLoader.getResource(s)));
    org.springframework.util.StringUtils.commaDelimitedListToSet(wsfed.getEncryptionPrivateKey()).forEach(s -> config.setEncryptionPrivateKey(this.resourceLoader.getResource(s)));
    org.springframework.util.StringUtils.commaDelimitedListToSet(wsfed.getEncryptionCertificate()).forEach(s -> config.setEncryptionCertificate(this.resourceLoader.getResource(s)));
    config.setEncryptionPrivateKeyPassword(wsfed.getEncryptionPrivateKeyPassword());
    config.setAttributeMutator(this.attributeMutator);
    return config;
}
Also used : WsFederationDelegationProperties(org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties) WsFederationConfiguration(org.apereo.cas.support.wsfederation.WsFederationConfiguration) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

WsFederationDelegationProperties (org.apereo.cas.configuration.model.support.wsfed.WsFederationDelegationProperties)2 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)2 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)2 Bean (org.springframework.context.annotation.Bean)2 WsFederationConfiguration (org.apereo.cas.support.wsfederation.WsFederationConfiguration)1 WsFederationCredentialsToPrincipalResolver (org.apereo.cas.support.wsfederation.authentication.principal.WsFederationCredentialsToPrincipalResolver)1