Hi,
My attributeRepository uses the class
org.jasig.services.persondir.support.MergingPersonAttributeDaoImpl
My first Dao uses the class
org.jasig.services.persondir.support.ldap.LdaptivePersonAttributeDao,
and LDAP searches five attributtes (cn, uid, gidNumber, homeDirectory,
sambaSID).
The class below makes the search properly ...
DEBUG
[org.jasig.services.persondir.support.ldap.LdaptivePersonAttributeDao] -
Converted ldap DN entry [uid=moncada,ou=Users,dc=CAS] to attribute map
{uid=[moncada],
sambaSID=[S-1-5-21-3487125291-501236746-2344796354-3480],
gidNumber=[100], cn=[JUAN CARLOS GIMENEZ MONCADA],
homeDirectory=[/home/moncada]}
But in this class the attributes (gidNumber, homeDirectory, sambaSID)
have disappeared.
DEBUG
[org.jasig.services.persondir.support.MergingPersonAttributeDaoImpl] -
Retrieved
attributes='[NamedPersonImpl[[email protected],attributes={uid=[moncada],
cn=[JUAN CARLOS GIMENEZ MONCADA]]]' for
query='{username=[[email protected]]}', isFirstQuery=false,
currentlyConsidering='org.jasig.services.persondir.support.ldap.LdaptivePersonAttributeDao@320bc246',
resultAttributes='null'
Attach configuration of deployerConfigContext.xml.
If I write the attributes in lower case letters in
deployerConfigContext.xml then they appear properly in Merging class.
Is there any property in xml's that doesn't let
LdaptivePersonAttributeDao normalize the attributes to lower case?
Thanks.
--
You received this message because you are subscribed to the Google Groups "CAS
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.
To view this discussion on the web visit
https://groups.google.com/a/apereo.org/d/msgid/cas-user/57037A95.80407%40um.es.
For more options, visit https://groups.google.com/a/apereo.org/d/optout.
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to Apereo under one or more contributor license
agreements. See the NOTICE file distributed with this work
for additional information regarding copyright ownership.
Apereo licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a
copy of the License at the following location:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
| deployerConfigContext.xml centralizes into one file some of the declarative configuration that
| all CAS deployers will need to modify.
|
| This file declares some of the Spring-managed JavaBeans that make up a CAS deployment.
| The beans declared in this file are instantiated at context initialization time by the Spring
| ContextLoaderListener declared in web.xml. It finds this file because this
| file is among those declared in the context parameter "contextConfigLocation".
|
| By far the most common change you will need to make in this file is to change the last bean
| declaration to replace the default authentication handler with
| one implementing your approach for authenticating usernames and passwords.
+-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:sec="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<!--
| The authentication manager defines security policy for authentication by specifying at a minimum
| the authentication handlers that will be used to authenticate credential. While the AuthenticationManager
| interface supports plugging in another implementation, the default PolicyBasedAuthenticationManager should
| be sufficient in most cases.
+-->
<bean id="authenticationManager" class="org.jasig.cas.authentication.PolicyBasedAuthenticationManager">
<constructor-arg>
<map>
<!--
| IMPORTANT
| Every handler requires a unique name.
| If more than one instance of the same handler class is configured, you must explicitly
| set its name to something other than its default name (typically the simple class name).
-->
<entry key-ref="proxyAuthenticationHandler" value-ref="proxyPrincipalResolver" />
<entry key-ref="ldapAuthenticationHandler" value-ref="primaryPrincipalResolver" />
<entry key-ref="primaryAuthenticationHandler" value-ref="primaryPrincipalResolver" />
<!-- <entry key-ref="ldapAuthenticationHandler" value="#{null}" /> -->
</map>
</constructor-arg>
<!-- Uncomment the metadata populator to capture the password. -->
<property name="authenticationMetaDataPopulators">
<util:list>
<bean class="org.jasig.cas.support.pac4j.authentication.ClientAuthenticationMetaDataPopulator" />
<bean class="org.jasig.cas.support.saml.authentication.SamlAuthenticationMetaDataPopulator"/>
<!--<bean class="org.jasig.cas.authentication.CacheCredentialsMetaDataPopulator"/>-->
</util:list>
</property>
<!--
| Defines the security policy around authentication. Some alternative policies that ship with CAS:
|
| * NotPreventedAuthenticationPolicy - all credential must either pass or fail authentication
| * AllAuthenticationPolicy - all presented credential must be authenticated successfully
| * RequiredHandlerAuthenticationPolicy - specifies a handler that must authenticate its credential to pass
-->
<property name="authenticationPolicy">
<bean class="org.jasig.cas.authentication.AnyAuthenticationPolicy" />
</property>
</bean>
<!-- Required for proxy ticket mechanism. -->
<bean id="proxyAuthenticationHandler" class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler" p:httpClient-ref="supportsTrustStoreSslSocketFactoryHttpClient" />
<!-- Required for proxy ticket mechanism -->
<bean id="proxyPrincipalResolver" class="org.jasig.cas.authentication.principal.BasicPrincipalResolver" />
<!-- Required for Twitter AUTH -->
<bean id="primaryAuthenticationHandler" class="org.jasig.cas.support.pac4j.authentication.handler.support.ClientAuthenticationHandler" c:theClients-ref="clients" />
<!--c:clients-ref="clients" />-->
<!--
| TODO: Replace this component with one suitable for your enviroment.
|
| This component provides authentication for the kind of credential used in your environment. In most cases
| credential is a username/password pair that lives in a system of record like an LDAP directory.
| The most common authentication handler beans:
|
| * org.jasig.cas.authentication.LdapAuthenticationHandler
| * org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler
| * org.jasig.cas.adaptors.x509.authentication.handler.support.X509CredentialsAuthenticationHandler
| * org.jasig.cas.support.spnego.authentication.handler.support.JCIFSSpnegoAuthenticationHandler
-->
<bean id="ldapAuthenticationHandler" class="org.jasig.cas.authentication.LdapAuthenticationHandler" p:principalIdAttribute="mail" c:authenticator-ref="authenticator" p:passwordPolicyConfiguration-ref="passwordPolicy" init-method="initialize" />
<bean id="authenticator" class="org.ldaptive.auth.Authenticator" c:resolver-ref="dnResolver" c:handler-ref="authHandler">
<property name="authenticationResponseHandlers">
<util:list>
<bean class="org.ldaptive.auth.ext.PasswordPolicyAuthenticationResponseHandler" />
</util:list>
</property>
</bean>
<bean id="dnResolver" class="org.ldaptive.auth.PooledSearchDnResolver" p:baseDn="${ldap.baseDn}" p:subtreeSearch="true" p:allowMultipleDns="false" p:connectionFactory-ref="searchPooledLdapConnectionFactory" p:userFilter="${ldap.authn.searchFilter}" />
<bean id="searchPooledLdapConnectionFactory" class="org.ldaptive.pool.PooledConnectionFactory" p:connectionPool-ref="searchConnectionPool" />
<bean id="searchConnectionPool" parent="abstractConnectionPool" p:connectionFactory-ref="searchConnectionFactory" />
<bean id="searchConnectionFactory" class="org.ldaptive.DefaultConnectionFactory" p:connectionConfig-ref="searchConnectionConfig" />
<bean id="searchConnectionConfig" parent="abstractConnectionConfig" p:connectionInitializer-ref="bindConnectionInitializer" />
<bean id="bindConnectionInitializer" class="org.ldaptive.BindConnectionInitializer" p:bindDn="${ldap.managerDn}">
<property name="bindCredential">
<bean class="org.ldaptive.Credential" c:password="${ldap.managerPassword}" />
</property>
</bean>
<bean id="abstractConnectionPool" abstract="true" class="org.ldaptive.pool.BlockingConnectionPool" init-method="initialize" destroy-method="close" p:poolConfig-ref="ldapPoolConfig" p:blockWaitTime="${ldap.pool.blockWaitTime}" p:validator-ref="searchValidator" p:pruneStrategy-ref="pruneStrategy" p:failFastInitialize="false" />
<bean id="abstractConnectionConfig" abstract="true" class="org.ldaptive.ConnectionConfig" p:ldapUrl="${ldap.url}" p:connectTimeout="${ldap.connectTimeout}" p:useStartTLS="${ldap.useStartTLS}" />
<bean id="ldapPoolConfig" class="org.ldaptive.pool.PoolConfig" p:minPoolSize="${ldap.pool.minSize}" p:maxPoolSize="${ldap.pool.maxSize}" p:validateOnCheckOut="${ldap.pool.validateOnCheckout}" p:validatePeriodically="${ldap.pool.validatePeriodically}" p:validatePeriod="${ldap.pool.validatePeriod}" />
<bean id="pruneStrategy" class="org.ldaptive.pool.IdlePruneStrategy" p:prunePeriod="${ldap.pool.prunePeriod}" p:idleTime="${ldap.pool.idleTime}" />
<bean id="searchValidator" class="org.ldaptive.pool.SearchValidator" />
<bean id="authHandler" class="org.ldaptive.auth.PooledBindAuthenticationHandler" p:connectionFactory-ref="bindPooledLdapConnectionFactory" />
<bean id="bindPooledLdapConnectionFactory" class="org.ldaptive.pool.PooledConnectionFactory" p:connectionPool-ref="bindConnectionPool" />
<bean id="bindConnectionPool" parent="abstractConnectionPool" p:connectionFactory-ref="bindConnectionFactory" />
<bean id="bindConnectionFactory" class="org.ldaptive.DefaultConnectionFactory" p:connectionConfig-ref="bindConnectionConfig" />
<bean id="bindConnectionConfig" parent="abstractConnectionConfig" />
<!--
| Resolves a principal from a credential using an attribute repository that is configured to resolve
| against a deployer-specific store (e.g. LDAP).
-->
<bean id="primaryPrincipalResolver" class="org.jasig.cas.authentication.principal.PersonDirectoryPrincipalResolver" p:principalFactory-ref="principalFactory" p:attributeRepository-ref="attributeRepository" />
<bean id="attributeRepository" class="org.jasig.services.persondir.support.MergingPersonAttributeDaoImpl">
<property name="personAttributeDaos">
<list>
<ref bean="LDAPattributeRepository" />
<ref bean="MySQLattributeRepository" />
</list>
</property>
</bean>
<bean id="LDAPattributeRepository" class="org.jasig.services.persondir.support.ldap.LdaptivePersonAttributeDao">
<property name="connectionFactory" ref="searchPooledLdapConnectionFactory" />
<property name="baseDN" value="${ldap.baseDn}" />
<property name="requireAllQueryAttributes" value="true" />
<property name="queryAttributeMapping">
<map>
<entry key="username" value="mail" />
</map>
</property>
<property name="resultAttributeMapping">
<map>
<entry key="cn" value="cn" />
<entry key="uid" value="uid" />
<entry key="gidNumber" value="gidNumber" />
<entry key="homeDirectory" value="homeDirectory" />
<entry key="sambaSID" value="sambaSID" />
</map>
</property>
</bean>
<bean id="MySQLattributeRepository" class="org.jasig.services.persondir.support.jdbc.MultiRowJdbcPersonAttributeDao">
<constructor-arg index="0" ref="MySQLDataSource" />
<constructor-arg index="1" value="SELECT 'source' as source, source_attr FROM attr_table WHERE attr_uid='xxx.xxx.xxx' AND {0}" />
<property name="requireAllQueryAttributes" value="true" />
<property name="nameValueColumnMappings">
<map>
<entry key="source" value="attr_table" />
</map>
</property>
<property name="queryAttributeMapping">
<map>
<entry key="username" value="user_attr" />
</map>
</property>
<property name="resultAttributeMapping">
<map>
<entry key="source" value="source" />
</map>
</property>
</bean>
<bean id="MySQLDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" p:driverClass="com.mysql.jdbc.Driver" p:jdbcUrl="jdbc:mysql://xxx.xxx.xx:3306/database?autoReconnect=true" p:user="username" p:password="passwd" p:initialPoolSize="3" p:minPoolSize="3" p:maxPoolSize="25" p:maxConnectionAge="240" p:maxIdleTime="90" p:maxIdleTimeExcessConnections="90" p:checkoutTimeout="3000" p:acquireIncrement="6" p:acquireRetryAttempts="2" p:acquireRetryDelay="1000" p:testConnectionOnCheckin="true" p:idleConnectionTestPeriod="60" p:preferredTestQuery="SELECT 1" />
<bean id="serviceRegistryDao" class="org.jasig.cas.services.JsonServiceRegistryDao" c:configDirectory="${service.registry.config.location:classpath:services}" />
<bean id="auditTrailManager" class="org.jasig.inspektr.audit.support.Slf4jLoggingAuditTrailManager" />
<bean id="healthCheckMonitor" class="org.jasig.cas.monitor.HealthCheckMonitor" p:monitors-ref="monitorsList" />
<util:list id="monitorsList">
<bean class="org.jasig.cas.monitor.MemoryMonitor" p:freeMemoryWarnThreshold="10" />
</util:list>
</beans>