Announcement Announcement Module
No announcement yet.
Samples tutorial using embedded ldap server Page Title Module
Move Remove Collapse
This topic is closed
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Samples tutorial using embedded ldap server


    I have tried to modify the samples tutorial 2.0.0 war file a bit to use the embedded ldap server instead of the default authentication-provider.

    I did the following changes in the namespace xml after deploying the war file to my Tomcat:

    HTML Code:
    <ldap-server ldif="classpath:users.ldif" />
            <ldap-authentication-provider />
        <ldap-user-service user-search-filter="(uid={0}" group-search-filter="member={0}"/>
            <password-encoder hash="md5"/>
                <user name="rod" password="a564de63c2d0da68cf47586ee05984d7" authorities="ROLE_SUPERVISOR, ROLE_USER, ROLE_TELLER" />
    	        <user name="dianne" password="65d15fe9156f9c4bbffd98085992a44e" authorities="ROLE_USER,ROLE_TELLER" />
                <user name="scott" password="2b58af6dddbd072ed27ffc86725d7d3a" authorities="ROLE_USER" />
                <user name="peter" password="22b5c9accc6e1ba628cedc63a72d57f8" authorities="ROLE_USER" />
    One reason for my test of the embedded ldap server was that in the RC1 M2 release of Spring Security 2.0 it seemed like the embedded ldap server was part of the samples tutorial war, since it was just commented away in the namespace configuration xml.

    When changing the above configuration and restarting my Tomcat two problems occured:

    - Additional jar files had to be put in to make embedded ldap work.
    - Loading Authorities didnt work for the users located in the default users.ldif.

    The first thing I solved by adding the following jar files (Im not specifying the versions just the missing jars):

    - apache ds jars (multiple files)
    - commons lang
    - spring ldap
    - shared ldap
    - slf4j log4j
    - slf4j api
    - jdbm
    - mina core
    - mina filter ssl
    - backport util concurrent
    - antlr
    - shared asn1
    - shared asn1 codec
    - avalon framework (not needed to make sample work?! but was included in the M2 release)
    - logkit (not needed to make sample work?! but was included in the M2 release)

    The other thing with the loading Authorites i havent solved, but I think it has to do with my other thread on this forum:

    with kind regards

  • #2
    There is a separate ldap sample in the project now which demonstrates a simple ldap configuration. I'd recommend you check that out. You can either build from source (follow the simple instructions on the web site) or download it from the maven repository


    • #3
      thank you for your answer Luke!

      I see now that there are multiple samples war files available and not one war file to cover all situations within Spring Security 2.0.

      Im going to try the suggested war file with embedded LDAP instead.

      Will the LDAP sample war file be included in upcoming release zip files or just available from the maven repository?



      • #4
        The release becomes rather large if we include all the samples - particularly as the LDAP one uses an embedded Apache Directory server, so we'll probably continue to include the first two sample apps in there.

        I'd recommend you have ago at building and running directly from the source tree. There are instructions on the website

        That way you can make use the SSL setup and so on without having to do much at all.

        I also need to add some more information to the docs on the additional samples.


        • #5
          Hi guys

          I want to use an embedded LDAP. I use, as in war file , a users.ldif file. My problem is that i want to extend the schema of my embedded LDAP directory and use my oxm objects and attributes and i don't know how doing this.

          If someone has the answer ...

          Thanh you very much