> Looks like you have a problem with your LDAP search filter string.
> Please share your deployerConfigContext.xml so we can help
> troubleshoot further.

Thanks for the quick reply Marvin. Please see attached for my scrubbed 
deployerConfigContext.xml

Gaz

-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user
<?xml version="1.0" encoding="UTF-8"?>
<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:tx="http://www.springframework.org/schema/tx";
       xmlns:sec="http://www.springframework.org/schema/security";
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd
	   http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd";>

	   <bean id="authenticationManager"
		class="org.jasig.cas.authentication.AuthenticationManagerImpl">

		<property name="credentialsToPrincipalResolvers">
				<list>

						<bean class="org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver" />

						<bean class="org.jasig.cas.authentication.principal.CredentialsToLDAPAttributePrincipalResolver">
						   <property name="credentialsToPrincipalResolver">
							 <bean class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver" />
						   </property>
						   <property name="filter" value="(userPrincipalName=%u)" />
						   <property name="principalAttributeName" value="userPrincipalName" />
						   <property name="searchBase" value="ou=staff,ou=users,dc=internal,dc=slcs,dc=ac,dc=uk" />
						   <property name="contextSource" ref="contextSource" />
						   <property name="attributeRepository">
							 <ref bean="attributeRepository" />
						   </property>
						 </bean>

				</list>
		</property>
				
		<property name="authenticationHandlers">
			<list>
				<bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
					p:httpClient-ref="httpClient" />
				<bean class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler">
					<property name="filter" value="userPrincipalName=%u" />
					<property name="searchBase" value="ou=staff,ou=users,dc=internal,dc=slcs,dc=ac,dc=uk" />
					<property name="contextSource" ref="contextSource" />
					<property name="ignorePartialResultException" value="yes" /> <!-- fix because of how AD returns results -->
				</bean>
			</list>
		</property>
	</bean>

    <sec:user-service id="userDetailsService">
        <sec:user name="xxxxxx" authorities="ROLE_ADMIN" />
    </sec:user-service>

	<bean id="abstractAttributeRepository" class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao" abstract="true">
			<property name="queryAttributeMapping">
					<map>
							<entry key="username" value="userPrincipalName" />
					</map>
			</property>
			<property name="resultAttributeMapping">
					<map>
							<entry key="givenName" value="givenName"/>
							<entry key="distinguishedName" value="distinguishedName" />
							<entry key="displayName" value="displayName" />
							<entry key="sn" value="sn" />
							<entry key="description" value="description" />
					</map>
			</property>
	</bean>

	<bean id="attributeRepository" parent="abstractAttributeRepository"
			p:baseDN="ou=staff,ou=users,dc=internal,dc=slcs,dc=ac,dc=uk"
			p:contextSource-ref="contextSource" />
				
	<bean id="serviceRegistryDao" class="org.jasig.cas.services.JpaServiceRegistryDaoImpl"
	   p:entityManagerFactory-ref="entityManagerFactory" />

	<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
		<property name="dataSource" ref="dataSource"/>
		<property name="jpaVendorAdapter">
			<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
				<property name="generateDdl" value="true"/>
				<property name="showSql" value="true" />
			</bean>
		</property>
		<property name="jpaProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
				<prop key="hibernate.hbm2ddl.auto">update</prop>
			</props>
		</property>
	</bean>

	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
		<property name="entityManagerFactory" ref="entityManagerFactory"/>
	</bean>

	<tx:annotation-driven transaction-manager="transactionManager"/>

	<bean
		id="dataSource"
		class="org.apache.commons.dbcp.BasicDataSource"
		p:driverClassName="com.mysql.jdbc.Driver"
		p:url="jdbc:mysql://xxxxxx:3306/xxxxxx?autoReconnect=true"
		p:password="xxxxxx"
		p:username="casdev" />
		
	<bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource">
		<property name="pooled" value="false"/>
		<property name="urls">
			<list>
				<value>xxxxxx</value>
				<value>xxxxxx</value>
				<value>xxxxxx</value>
				<value>xxxxxx</value>
			</list>
		</property>
		<property name="userDn" value="xxxxxx"/>
		<property name="password" value="xxxxxx"/>
		<property name="baseEnvironmentProperties">
			<map>
				<entry>
						<key>
							<value>java.naming.security.authentication</value>
						</key>
						<value>simple</value>
				</entry>
			</map>
		</property>
	</bean>
</beans>

Reply via email to