Announcement Announcement Module
Collapse
No announcement yet.
Spring and Spring security version Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring and Spring security version

    Hi all,
    It's finally time to upgrade our version of spring here and I was wondering what version of Spring (the regular Spring) should go along with Spring Security. We will be using Spring Security 3.0.3, since it's an official release and we don't want any critical issue.

    This being said, I've started playing with it a little bit and I find some weird things. For example, if I want to use a FilterBasedLdapUserSearch and use the searchForUser method, it returns a org.springframework.ldap.core.DirContextOperations which doesn't exists in Spring 3.

    Is there a specific reason or is there something I don't understand correctly here?!

    Thanks

  • #2
    You should use Spring 3 with Spring Security 3. The ldap code is in Spring Ldap. You may want to take a look at the samples applications for working versions.

    Comment


    • #3
      Unfortunately, I don't want to use it with a xml file (or any config files), we have some special use for it and I need to use it inside a class.

      I'm in charge of migration for some part of our application and we use a LdapTemplate (present in some old obscure version of Spring). I'm looking for an equivalent but, as I've said, I need to use it inside one of my class.

      Comment


      • #4
        It seemed like you were having a dependency management issue (i.e. not finding the class you would like to use). If you are not using Spring config, the examples illustrate all the dependencies you need even if it is more than you need. I'm not sure I can be of any more help w/out a little more details on what you are trying to do.

        PS: The Spring Security projects do use configuration but you can just as easily instantiate the objects using pure java code (it translates pretty literally).

        Comment


        • #5
          The things is that I have a client that is managing many types of authentication, one of these types is LDAP. This client is then packaged as a jar file and used in other applications.

          Basically, I'm looking for any class that could make a LDAP authentication to a server with a username and password. If there are also any interface I could implements this could help me a lot.

          Edit #1 :
          I'm actually trying to use a PasswordComparisonAuthenticator and guess what type I need as a parameter, it's a org.springframework.ldap.core.support.BaseLdapPath ContextSource. This would be great if this class would actually EXISTS in the Spring 3.0 framework...

          Any ideas? I'm starting to think that Spring security 3.0.x was built over the specs of Spring 2.x... Am I missing something or what?!
          Last edited by mireaulf; Oct 1st, 2010, 12:48 PM. Reason: added details

          Comment


          • #6
            It still looks like you are having problems with your dependencies. If you are looking for ldap code you should look in the Spring LDAP project. If it doesn't start with org.springframework.security it is not part of the Spring Security project.

            Comment


            • #7
              Thanks, that solved the problem

              Comment


              • #8
                Is LdapTemplate the old way of connecting to Ldap with Spring? I'm currently setting up security and I used LdapTemplate but I'm not sure if I even need to use it. I need to integrate Spring Security and LdapTemplate if I should be using LdapTemplate so that my services can access the logged in user and match an Employee reference to an Ldap user.

                Comment


                • #9
                  Spring Security uses spring ldap behind the scenes. In many cases you will not need to interact with the the ldap libraries directly since Spring Security does this for you. In some cases, you may use them for customizations.

                  Comment


                  • #10
                    Well if I wanted to create a UserDao that access Ldap users to call findAllUsers() would it be easier to have an implementation that uses LdapTemplate or should I be using Spring Ldap? If I implement my own custom UserDetailsService wouldn't I be using my UserDao/LdapTemplate implementation to do the searching and other methods?

                    Comment


                    • #11
                      Originally posted by dukethrash View Post
                      Well if I wanted to create a UserDao that access Ldap users to call findAllUsers() would it be easier to have an implementation that uses LdapTemplate or should I be using Spring Ldap?
                      LdapTemplate is part of Spring LDAP. This means if you use LdapTemplate, then you are using Spring LDAP. If you are meaning SpringSecurityLdapTemplate, then that is part of Spring Security which extends Spring LDAP. Which one you use depends on what you actually need.

                      Originally posted by dukethrash View Post
                      If I implement my own custom UserDetailsService wouldn't I be using my UserDao/LdapTemplate implementation to do the searching and other methods?
                      I don't think you would have the need to write your own implementation of LdapTemplate, but yes you would be able to use your own UserDao. I would probably try to start off with Spring Security's LDAP Authentication and extend where necessary.

                      Comment

                      Working...
                      X