Search in sources :

Example 1 with SpnegoProperties

use of org.apereo.cas.configuration.model.support.spnego.SpnegoProperties in project cas by apereo.

the class SpnegoConfiguration method spnegoHandler.

@Bean
@RefreshScope
public AuthenticationHandler spnegoHandler() {
    final SpnegoProperties spnegoProperties = casProperties.getAuthn().getSpnego();
    final JcifsSpnegoAuthenticationHandler h = new JcifsSpnegoAuthenticationHandler(spnegoProperties.getName(), servicesManager, spnegoPrincipalFactory(), spnegoAuthentication(), spnegoProperties.isPrincipalWithDomainName(), spnegoProperties.isNtlmAllowed());
    h.setAuthentication(spnegoAuthentication());
    h.setPrincipalWithDomainName(spnegoProperties.isPrincipalWithDomainName());
    h.setNTLMallowed(spnegoProperties.isNtlmAllowed());
    return h;
}
Also used : JcifsSpnegoAuthenticationHandler(org.apereo.cas.support.spnego.authentication.handler.support.JcifsSpnegoAuthenticationHandler) SpnegoProperties(org.apereo.cas.configuration.model.support.spnego.SpnegoProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with SpnegoProperties

use of org.apereo.cas.configuration.model.support.spnego.SpnegoProperties in project cas by apereo.

the class SpnegoWebflowActionsConfiguration method negociateSpnego.

@Bean
@RefreshScope
public Action negociateSpnego() {
    final SpnegoProperties spnegoProperties = casProperties.getAuthn().getSpnego();
    final List<String> supportedBrowsers = Stream.of(spnegoProperties.getSupportedBrowsers().split(",")).collect(Collectors.toList());
    return new SpnegoNegociateCredentialsAction(supportedBrowsers, spnegoProperties.isNtlm(), spnegoProperties.isMixedModeAuthentication());
}
Also used : SpnegoProperties(org.apereo.cas.configuration.model.support.spnego.SpnegoProperties) SpnegoNegociateCredentialsAction(org.apereo.cas.web.flow.SpnegoNegociateCredentialsAction) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Example 3 with SpnegoProperties

use of org.apereo.cas.configuration.model.support.spnego.SpnegoProperties in project cas by apereo.

the class SpnegoWebflowActionsConfiguration method ldapSpnegoClientAction.

@Lazy
@Bean
@RefreshScope
public Action ldapSpnegoClientAction() {
    final SpnegoProperties spnegoProperties = casProperties.getAuthn().getSpnego();
    final ConnectionFactory connectionFactory = Beans.newLdaptivePooledConnectionFactory(spnegoProperties.getLdap());
    final SearchFilter filter = Beans.newLdaptiveSearchFilter(spnegoProperties.getLdap().getSearchFilter(), "host", Collections.emptyList());
    final SearchRequest searchRequest = Beans.newLdaptiveSearchRequest(spnegoProperties.getLdap().getBaseDn(), filter);
    return new LdapSpnegoKnownClientSystemsFilterAction(spnegoProperties.getIpsToCheckPattern(), spnegoProperties.getAlternativeRemoteHostAttribute(), spnegoProperties.getDnsTimeout(), connectionFactory, searchRequest, spnegoProperties.getSpnegoAttributeName());
}
Also used : SearchRequest(org.ldaptive.SearchRequest) ConnectionFactory(org.ldaptive.ConnectionFactory) LdapSpnegoKnownClientSystemsFilterAction(org.apereo.cas.web.flow.client.LdapSpnegoKnownClientSystemsFilterAction) SpnegoProperties(org.apereo.cas.configuration.model.support.spnego.SpnegoProperties) SearchFilter(org.ldaptive.SearchFilter) Lazy(org.springframework.context.annotation.Lazy) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Bean(org.springframework.context.annotation.Bean)

Example 4 with SpnegoProperties

use of org.apereo.cas.configuration.model.support.spnego.SpnegoProperties in project cas by apereo.

the class SpnegoConfiguration method jcifsConfig.

@Bean
@RefreshScope
public JcifsConfig jcifsConfig() {
    final JcifsConfig c = new JcifsConfig();
    final SpnegoProperties spnego = casProperties.getAuthn().getSpnego();
    c.setJcifsDomain(spnego.getJcifsDomain());
    c.setJcifsDomainController(spnego.getJcifsDomainController());
    c.setJcifsNetbiosCachePolicy(spnego.getCachePolicy());
    c.setJcifsNetbiosWins(spnego.getJcifsNetbiosWins());
    c.setJcifsPassword(spnego.getJcifsPassword());
    c.setJcifsServicePassword(spnego.getJcifsServicePassword());
    c.setJcifsServicePrincipal(spnego.getJcifsServicePrincipal());
    c.setJcifsSocketTimeout(spnego.getTimeout());
    c.setJcifsUsername(spnego.getJcifsUsername());
    c.setKerberosConf(spnego.getKerberosConf());
    c.setKerberosDebug(spnego.getKerberosDebug());
    c.setKerberosKdc(spnego.getKerberosKdc());
    c.setKerberosRealm(spnego.getKerberosRealm());
    c.setLoginConf(spnego.getLoginConf());
    c.setUseSubjectCredsOnly(spnego.isUseSubjectCredsOnly());
    return c;
}
Also used : JcifsConfig(org.apereo.cas.support.spnego.authentication.handler.support.JcifsConfig) SpnegoProperties(org.apereo.cas.configuration.model.support.spnego.SpnegoProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 5 with SpnegoProperties

use of org.apereo.cas.configuration.model.support.spnego.SpnegoProperties in project cas by apereo.

the class SpnegoConfiguration method spnegoPrincipalResolver.

@Bean
@RefreshScope
public PrincipalResolver spnegoPrincipalResolver() {
    final SpnegoProperties spnegoProperties = casProperties.getAuthn().getSpnego();
    final SpnegoPrincipalResolver r = new SpnegoPrincipalResolver();
    r.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(spnegoProperties.getPrincipalTransformation()));
    r.setAttributeRepository(attributeRepository);
    r.setPrincipalAttributeName(spnegoProperties.getPrincipal().getPrincipalAttribute());
    r.setReturnNullIfNoAttributes(spnegoProperties.getPrincipal().isReturnNull());
    r.setPrincipalFactory(spnegoPrincipalFactory());
    return r;
}
Also used : SpnegoPrincipalResolver(org.apereo.cas.support.spnego.authentication.principal.SpnegoPrincipalResolver) SpnegoProperties(org.apereo.cas.configuration.model.support.spnego.SpnegoProperties) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

SpnegoProperties (org.apereo.cas.configuration.model.support.spnego.SpnegoProperties)5 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)5 Bean (org.springframework.context.annotation.Bean)5 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)3 JcifsConfig (org.apereo.cas.support.spnego.authentication.handler.support.JcifsConfig)1 JcifsSpnegoAuthenticationHandler (org.apereo.cas.support.spnego.authentication.handler.support.JcifsSpnegoAuthenticationHandler)1 SpnegoPrincipalResolver (org.apereo.cas.support.spnego.authentication.principal.SpnegoPrincipalResolver)1 SpnegoNegociateCredentialsAction (org.apereo.cas.web.flow.SpnegoNegociateCredentialsAction)1 LdapSpnegoKnownClientSystemsFilterAction (org.apereo.cas.web.flow.client.LdapSpnegoKnownClientSystemsFilterAction)1 ConnectionFactory (org.ldaptive.ConnectionFactory)1 SearchFilter (org.ldaptive.SearchFilter)1 SearchRequest (org.ldaptive.SearchRequest)1 Lazy (org.springframework.context.annotation.Lazy)1