Search in sources :

Example 6 with X509Properties

use of org.apereo.cas.configuration.model.support.x509.X509Properties in project cas by apereo.

the class X509AuthenticationConfiguration method x509SubjectPrincipalResolver.

@Bean
@RefreshScope
public PrincipalResolver x509SubjectPrincipalResolver() {
    final X509Properties x509 = casProperties.getAuthn().getX509();
    final X509SubjectPrincipalResolver r = new X509SubjectPrincipalResolver(x509.getPrincipalDescriptor());
    r.setAttributeRepository(attributeRepository);
    r.setPrincipalAttributeName(x509.getPrincipal().getPrincipalAttribute());
    r.setReturnNullIfNoAttributes(x509.getPrincipal().isReturnNull());
    r.setPrincipalFactory(x509PrincipalFactory());
    return r;
}
Also used : X509SubjectPrincipalResolver(org.apereo.cas.adaptors.x509.authentication.principal.X509SubjectPrincipalResolver) X509Properties(org.apereo.cas.configuration.model.support.x509.X509Properties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 7 with X509Properties

use of org.apereo.cas.configuration.model.support.x509.X509Properties in project cas by apereo.

the class X509AuthenticationConfiguration method crlDistributionPointRevocationChecker.

@Bean
public RevocationChecker crlDistributionPointRevocationChecker() {
    final X509Properties x509 = casProperties.getAuthn().getX509();
    final Cache cache = new Cache("CRL".concat(UUID.randomUUID().toString()), x509.getCacheMaxElementsInMemory(), x509.isCacheDiskOverflow(), x509.isCacheEternal(), x509.getCacheTimeToLiveSeconds(), x509.getCacheTimeToIdleSeconds());
    return new CRLDistributionPointRevocationChecker(x509.isCheckAll(), getRevocationPolicy(x509.getCrlUnavailablePolicy()), getRevocationPolicy(x509.getCrlExpiredPolicy()), cache, crlFetcher(), x509.isThrowOnFetchFailure());
}
Also used : CRLDistributionPointRevocationChecker(org.apereo.cas.adaptors.x509.authentication.revocation.checker.CRLDistributionPointRevocationChecker) X509Properties(org.apereo.cas.configuration.model.support.x509.X509Properties) Cache(net.sf.ehcache.Cache) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

X509Properties (org.apereo.cas.configuration.model.support.x509.X509Properties)7 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)7 Bean (org.springframework.context.annotation.Bean)7 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)6 CRLDistributionPointRevocationChecker (org.apereo.cas.adaptors.x509.authentication.revocation.checker.CRLDistributionPointRevocationChecker)3 Cache (net.sf.ehcache.Cache)2 X509CredentialsAuthenticationHandler (org.apereo.cas.adaptors.x509.authentication.handler.support.X509CredentialsAuthenticationHandler)2 X509SerialNumberPrincipalResolver (org.apereo.cas.adaptors.x509.authentication.principal.X509SerialNumberPrincipalResolver)2 X509SubjectAlternativeNameUPNPrincipalResolver (org.apereo.cas.adaptors.x509.authentication.principal.X509SubjectAlternativeNameUPNPrincipalResolver)2 X509SubjectDNPrincipalResolver (org.apereo.cas.adaptors.x509.authentication.principal.X509SubjectDNPrincipalResolver)2 X509SubjectPrincipalResolver (org.apereo.cas.adaptors.x509.authentication.principal.X509SubjectPrincipalResolver)2 NoOpRevocationChecker (org.apereo.cas.adaptors.x509.authentication.revocation.checker.NoOpRevocationChecker)2 ResourceCRLRevocationChecker (org.apereo.cas.adaptors.x509.authentication.revocation.checker.ResourceCRLRevocationChecker)2 RevocationChecker (org.apereo.cas.adaptors.x509.authentication.revocation.checker.RevocationChecker)2 Set (java.util.Set)1 UUID (java.util.UUID)1 Collectors (java.util.stream.Collectors)1 StringUtils (org.apache.commons.lang3.StringUtils)1 CRLFetcher (org.apereo.cas.adaptors.x509.authentication.CRLFetcher)1 ResourceCRLFetcher (org.apereo.cas.adaptors.x509.authentication.ResourceCRLFetcher)1