Announcement Announcement Module
Collapse
No announcement yet.
Embedded LDap and Custom Schema Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Embedded LDap and Custom Schema

    Hi,

    I have to make some unit tests on an application which used a LDap. So i want to test this application with an embedded LDAP. I've configured my spring-security.xml and my beans without problem.

    Code:
        <bean id="contextSource" class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
    		<constructor-arg value="ldap://127.0.0.1:33389"/>
    	  <property name="userDn" value="uid=user,ou=agents,dc=toto,dc=com"/>
    	  <property name="password" value="pwd"/>
      	</bean>
    I've got a ldif, but some attributes are in custom schema.
    So, how can I import theses Schemas in the embedded LDAP ?
    I've got my schemas in ldif files as :

    Code:
    dn: cn=myRight, ou=schema
    objectclass: metaSchema
    objectclass: top
    cn: myRight
    
    dn: ou=attributeTypes, cn=myRight, ou=schema
    objectclass: organizationalUnit
    objectclass: top
    ou: attributetypes
    
    dn: m-oid=1.3.6.1.4.1.31535.2.3.1.1.2.2.1, ou=attributeTypes, cn=myRight
     , ou=schema
    objectclass: metaAttributeType
    objectclass: metaTop
    objectclass: top
    m-oid: 1.3.6.1.4.1.31535.2.3.1.1.2.2.1
    m-name: myRightId
    m-syntax: 1.3.6.1.4.1.1466.115.121.1.15
    m-length: 0
    But when the context is created, i've got the error :

    ERROR o.a.d.s.p.s.store.LdifFileLoader - Failed to import LDIF into backing store.
    javax.naming.NamingException: Failed to initialize search base cn=myRight, ou=schema
    Thanks a lot !

  • #2
    I'm afraid there is no way to add schema using the existing implementation. You would have to use an Apache Directory server directly ( you can embed one using Spring, I believe, as they have their own namespace in 1.5). There are a few issues open in Jira related to upgrading ApacheDS but the support in Spring Security is only intended to be for very basic testing.

    Comment


    • #3
      Ok, thanks for your response. I will search another solution .

      Comment

      Working...
      X