• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Spring security with LDAP Authentication

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to make ldap connection with spring security. This is connecting with normal JNDI but not with spring security. My LDAP server is on windows with NTLM authentication. I even disabled NTLM authentication but this is not working. Please help with this at the earliest



@Override
public void configure(AuthenticationManagerBuilder auth) throws Exception {

                 auth
.ldapAuthentication()
.contextSource()
.url("ldap://ipaddress:389/DC=LDAPTest,DC=com")
.managerDn("administrator@ldaptest.com")
.managerPassword("mypassword")
.and()
.userSearchBase("OU=CRYSTAL,DC=LDAPTest,DC=com");
// .userDnPatterns("cn={0}");
}
 
Saloon Keeper
Posts: 26549
187
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch, Saritha!

If you're looking for a cookbook answer, we're not the place to look. And since we're not paid to do this, "urgent" isn't something you should expect here either. Our primary purpose is to help people learn in an environment where they can feel comfortable and not get flamed or called stupid.

When using Active Directory for authentication the main thing to keep in mind is that unlike other LDAP servers, Active Directory has special entries that describe Windows-specific user properties and so the LDAP search rules have to be set up to use those properties instead of the more general ones you may see in non-AD LDAP examples. Do an Internet search for "Windows Active Directory LDAP authentication" and you should find some specifics.

One thing to note, though. If all application users are going to be local Windows users operating under their own identifies, you can bypass the whole LDAP thing and use basic NTLM single-signon authentication so that a user never actually has to login to the app itself, since they logged into Windows already. In the case of the Tomcat webapp server, for example, there's a custom security Realm module you can use. Actually more than one, I think. The original one was called CAS.
 
reply
    Bookmark Topic Watch Topic
  • New Topic