<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Copyright 2010 Red Hat, Inc.
  ~
  ~  Red Hat 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
  ~
  ~     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.
  -->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:jaas="http://karaf.apache.org/xmlns/jaas/v1.1.0"
           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0">

    <cm:property-placeholder persistent-id="com.fusesource.fmc.ldap.jaas" update-strategy="reload">
        <cm:default-properties>
            <cm:property name="ldap.url" value="ldap://localhost:10389" />
        </cm:default-properties>
    </cm:property-placeholder>

    <jaas:config name="karaf" rank="1">
        <jaas:module className="org.apache.karaf.jaas.modules.ldap.LDAPLoginModule" flags="required">
            connection.url = ${ldap.url}
            user.base.dn = ou=users,dc=fon
            user.filter = (uid=%u)
            user.search.subtree = true
            role.base.dn = ou=groups,dc=fon
            role.filter = (uniqueMember=uid=%u)
            role.name.attribute = cn
            role.search.subtree = true
            authentication = simple
        </jaas:module>
    </jaas:config>

</blueprint>
