Results 1 to 3 of 3

Thread: Embedded LDap and Custom Schema

Hybrid View

  1. #1
    Join Date
    Jul 2009
    Location
    france
    Posts
    2

    Question 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. #2
    Luke Taylor is offline Senior Member Acegi Security System TeamSpring Team
    Join Date
    Aug 2004
    Location
    Glasgow, Scotland
    Posts
    3,449

    Default

    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.
    Spring - by Pivotal
    twitter @tekul

  3. #3
    Join Date
    Jul 2009
    Location
    france
    Posts
    2

    Default

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •