• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Validating user in NDS

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic