1

I have been working with Java Native Interface for sometime now. Suddenly I saw the topic of Active Directory users.I am completely new to this area.

Can Someone tell me what is this about?

Thanks in Advance!!!!

Kasinaat 007
  • 124
  • 14

1 Answers1

1

The simple way to talk to Active Directory is to use a Java LDAP library. This is covered by extensively in other Q&A's and off-site resources. For example:


Now to your specific question:

How to to get the properties of an AD user using JNI?

You could use JNI to access Active Directory. You would need to:

  1. Find a suitable native LDAP library.
  2. Implement your own LDAP API classes for Java, with native methods for calling the native library
  3. Write some C code to bridge the Java native calls to calls ro the native LDAP library (using JNI).
  4. Solve the extra build / test / deployment / portability problems that come with any native code project.

Once you have done that, use your shiny new API to issue the appropriate LDAP query.

In short: it could be done, but there is no real benefit in doing it.


Suggested read: The Law of the Instrument.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216