<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
    xsi:schemaLocation="
        http://www.springframework.org/schema/security 
        http://www.springframework.org/schema/security/spring-security.xsd
        http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-4.2.xsd"
>

    <http auto-config="true" use-expressions="true">
        <intercept-url pattern="/" access="permitAll"/>
        <intercept-url pattern="/home" access="permitAll"/>
        <intercept-url pattern="/login" access="permitAll"/>
        <intercept-url pattern="/secure" access="isAuthenticated()"/>
        
        <form-login login-page='/login' default-target-url="/" authentication-failure-url="/login?error" />
        <logout logout-success-url="/" />
    </http>

    <authentication-manager>
            <ldap-authentication-provider
                user-search-base="ou=people"
                user-search-filter="(uid={0})"
                group-search-base="ou=groups"
                group-search-filter="(member={0})"
                >
            </ldap-authentication-provider>
    </authentication-manager>
    
    <ldap-server root="dc=baeldung,dc=com" ldif="users.ldif"/>
    

</beans:beans>