Win a copy of Spark in Action this week in the Open Source Projects forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Validating user in NDS

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I�m developing an application that needs to validate an user in NDS (Novell Directory Service). Does anyone have a class or package that could help me with it?
Thank you.
 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's some OLD code (I've refined it over the years) that will basically do the trick.

If the returned value is null, then the data (url, user, password) failed to validate for some reason. Obviously you want to replace the "xxxxxx" with the actual container name in your tree. This example hard-codes the port number, but you can easily modify it to take the port as a parameter in case you want to override it.
The "String credents = ..." was set up to force a password; the directory may define default access and allow users in w/out authentication. This prevents them from bypassing default authentication by putting in a dummy password [that will fail] if they don't supply one.
The "DirContext" object can be used to search the directory for whatever you're looking for.
If all you care about is authentication, then you can change it to return etiher "true" [if everything works] or "false" [otherwise].
It's fairly easy to modify this to support secure LDAP if that is needed.
[ November 05, 2003: Message edited by: Wayne L Johnson ]
 
Joey Alencar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wayne,
Thank you very much, it works perfectly. I have another question: how can I get a parameter from NDS? Should I use the ".getAttributes()" method?
Thanks.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic