How to configure embedded apacheds with spring security?



I'm new with Ldap and I'm struggling with spring security and ApacheDs. All I need is that the embeeded apacheDs persist all data. When I start up my jboss application, starts up the apacheds server too, this is running properly, but during the executions of the system, I made changes on apacheDs server, i.e a new user, and when I shutdown the server all data in the apacheDs is lost.


I searched for parameters to change the in memory method to a form of persistence, ldfi, etc but I can't find nothing.


Is there a way to change the configuration of apacheDs to persist the data?


Follow my ApplicationContextSecurity.xml configuration:



<security:authentication-manager>
<security:ldap-authentication-provider
group-search-filter="(uniqueMember={0})"
group-search-base="ou=perfil"
group-role-attribute="cn"
role-prefix="ROLE_"
user-search-filter="(uid={0})"
user-search-base="ou=users"
user-context-mapper-ref="customUserDetailsContextMapper">
<security:password-compare hash="plaintext"/>
</security:ldap-authentication-provider>
</security:authentication-manager>


<security:ldap-server id="context" root="o=suse" ldif="classpath:ldap/suse.ldif"/>


plus this configuration on applicationContext.xml



<ldap:context-source id="contextSource"
password="secret"
url="ldap://127.0.0.1:33389"
username="uid=admin,ou=system"
base="o=suse" />

<ldap:ldap-template id="ldapTemplate" context-source-ref="contextSource"/>
<bean class="org.springframework.ldap.core.support.BaseLdapPathBeanPostProcessor" />

<ldap:repositories base-package="br.xxx.xxxxx.jpa.repository.ambiente.ldap" />

<bean id="customUserDetailsContextMapper" class="br.com.simplesmenteuse.security.CustomUserDetailsContextMapper" />


With all of this the apacheDs works except the fact of when the server stops all data is lost.


No comments:

Post a Comment