Package javaforce

Class LDAP

java.lang.Object
javaforce.LDAP

public class LDAP extends Object
  • Field Details

    • lastException

      public Exception lastException
  • Constructor Details

    • LDAP

      public LDAP()
  • Method Details

    • login

      public boolean login(String server, String domain, String username, String password)
      Logins into a LDAP Server.
      Parameters:
      server - = LDAP server (FQN)
      domain - = domain (ie: example)
      username - = username
      password - = password
      Returns:
      login successful
    • close

      public void close()
    • getAttributes

      public String[] getAttributes(String domain_dn, String key, String[] attrs)
      Returns user object attributes. Must login() first
      Parameters:
      domain_dn - = domain as dn (distinguished name) (ie: DC=example,DC=com)
      key - = search key (ie: SAMAccountName=bob)
      attrs - = list of attributes to read (ie: member)
      Returns:
      attributes in order of attrs
    • memberOf

      public boolean memberOf(String domain_dn, String username, String group)
      Queries user to determine if they are a member of a group. Must login() first.
      Parameters:
      domain_dn - = domain as dn (distinguished name) (ie: DC=example,DC=com)
      username - = user to check for
      group - = group name
      Returns:
      user is a member
    • build_dn

      public static String build_dn(String domain)
      Create distinguished name from dot domain name.
    • getLastException

      public Exception getLastException()
    • main

      public static void main(String[] args)