Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring LDAP/Active Directory Security: Authenticate User w/out Using an Admin/Mgr Account

 
Gregg Leichtman
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Spring Security 3.1.0M2 and LDAP 1.3.1, the most current as of this date, to authenticate users via a login form. I am trying to determine if it is possible to eliminate the need for an admin/mgr account, as declared below in the DefaultSpringSecurityContextSource. On our LDAP server, all users are able to connect to and query the server, so there is no need for an admin account to do this and this is actually undesirable for our company needs. Can anyone state that this is definitely not possible with Spring Security, or if it is possible point me to either configuration or code to accomplish this?

I am successfully authenticating users with the following Spring configuration:
-=> Gregg <=-
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It might be possible with Spring's Expression Language. Spring Security supports the expression language.

Or you can always customize Spring Security to do this. In this case, those Spring LDAP classes can be extended or I am sure there is an interface that you can implement and then you write custom code in the setUserDn or setPassword methods, but it might also entail overriding methods in the other LDAP classes that reference the "ldapServer" bean and then take the data coming in through the Http request from the login form.

Or, doing a Google search or two I found this
http://www.jarvana.com/jarvana/view/org/springframework/ldap/spring-ldap/1.2/spring-ldap-1.2-javadoc.jar!/org/springframework/ldap/core/AuthenticationSource.html

You might just implement this method and that would be the only custom class you need to deal with in Java, then add it to the config and use your custom one.

Mark



 
Ramana Chilakalapudi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gregg,

I am new to Spring Security and your post looks quite useful. I have a similar requirement of integrating with Active Directory.

In your security application context can you please throw some light on the functionality of the class "com.myCompany.myWebappContext.server.security.RoleGrantingLdapAuthoritiesPopulator".

Also if you can put some light on your web layer, i mean your web.xml and any jsp's for controlling the authorization it would be very helpful.

Thanks,
Ramana
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic