<?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:security="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/security http://www.springframework.org/schema/security/spring-security.xsd">

	<security:authentication-manager>
		<security:authentication-provider ref="adAuthProvider"/>
	</security:authentication-manager>
	
	<bean id="adAuthProvider" class="org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider">
		<constructor-arg name="domain" value="${ad.domain}"/>
		<constructor-arg name="url" value="${ad.ldapUrl}"/>
		<property name="userDetailsContextMapper" ref="adUserMapper"/>
	</bean>
	
	<bean id="adUserMapper" class="info.bukova.isspst.services.users.AdUserCtxMapper">
		<constructor-arg name="userService" ref="userService"/>
		<constructor-arg name="roleService" ref="roleService"/>
		<property name="allowedGroup" value="${ad.allowedGroup}"/>
	</bean>

</beans>
