Top LDAP (Lightweight Directory Access Protocol) Interview Questions (2024) | CodeUsingJava
















Most frequently Asked LDAP (Lightweight Directory Access Protocol) Interview Questions


  1. What is LDAP?
  2. Where can LDAP used?
  3. What is Port Number for LDAP?
  4. How can we configure Ldap protocol?
  5. What is LDIF?
  6. What are the objects used by LDAP?
  7. What is JNDI?
  8. Name the Three Ldap Client Utilities Or Applications?
  9. How can we save the LDAP SSL Certificate from OpenSSL?
  10. How can we find out which server hosts LDAP on my windows domain?
  11. What is OpenLDAP?
  12. How can we delete one attribute in LDAP with LDIF?
  13. How do nested groups work?
  14. How would we add further levels of nesting though?


What is LDAP?

LDAP is a Directory Access Protocol, that is based on client server model and runs on a layer above TCP/IP stack.It also provides a facility for connecting, accessing, modifying and searching the internet directory.
LDAP contains information is organized in a form of directory, the clients ask servers for providing information or performing some operation on the particular information. There are two types of LDAP:
Transparent
Plug-in

Where can LDAP used?

LDAP is a Lightweight Directory Access Protocol which is used for queries and modification purposes as it is also used in places like Microsoft Active Directory, OPEN LDAP, and many more.

What is Port Number for LDAP?

Port number for LDAP are LDAP - 389 and LDAPS - 636.

How can we configure LDAP protocol?

We can configure LDAP protocol by using:
Installing openldap-servers package.
Modifying olcDatabasev bdb.ldif file and olcDatabasev monitor.ldif file.
Creating Database Cache and update Database.
Creating certificate for TLS and provide ownership of ldap group to your certificate.
Restarting slapd service.

What is LDIF?

LDIF is used for exchanging data between the LDAP directory servers.The content is represented as a group of attributes, as the records are separated from one another by blank lines while the attributes of the record that are represented as single logical lines.LDIF deploys tools such as Microsoft Windows 2000 Server, Windows 2003 Server, JXplorer, Netscape Communicator, and OpenLDAP.

What are the objects used by LDAP?

There are 3 types of objects used by LDAP:
  • Structural - helps in defining the primary entry type.
  • Auxiliary - helps in defining the characteristics of an LDAP entry.
  • Abstract - helps in creating entries directly and is subclassed by the Auxiliary Class.


What is JNDI?

Java Naming and Directory Interface is a Java API for directory services and allows Java software clients in discovering data and resources.It helps in specifying service provider interface for allowing directory service implementations to be plugged into the framework.It is also used in connecting Java Application to an external directory services and also allowing a Java Servlet to lookup configuration information provided by hosting web container.

Name the Three Ldap Client Utilities Or Applications?

ldapsearch
ldapadd
ldapmodify

How can we save the LDAP SSL Certificate from OpenSSL?


echo -n | openssl s_client -connect 192.168.1.225:636 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ldapserver.pem


How can we find out which server hosts LDAP on my windows domain?


C:\> nslookup
> set types=all
> _ldap._tcp.<<your.AD.domain>>
_ldap._tcp.<<your.AD.domain>>  SRV service location:
      priority       = 0
      weight         = 100
      port           = 389
      svr hostname   = <<ldap.hostname>>.<<your.AD.domain>>
 


What is OpenLDAP?

OpenLDAP is an open source that is used in consolidating data of an entire organization into central repository.It provides full compliance with LDAP data interchange format version, it supports Simple Authentication, Security Layer, and Transport Layer Security.

How can we delete one attribute in LDAP with LDIF?


dn: cn=USER,ou=groups,dc=s2rsolutions,dc=com
changetype: modify
delete: uniqueMember
uniqueMember: cn=jsmith,ou=users,dc=s2rsolutions,dc=com


How do nested groups work?


 # create FIRST Level groups branch

    dn: ou=groups,dc=example,dc=com
    objectclass:organizationalunit
    ou: groups
    description: generic groups branch

    # create the itpeople entry under groups

    dn: cn=itpeople,ou=groups,dc=example,dc=com
    objectclass: groupofnames
    cn: itpeople
    description: IT security group
    member: cn=William Smith,ou=people,dc=example,dc=com

    # create the hrpeople entry under groups

    dn: cn=hrpeople,ou=groups,dc=example,dc=com
    objectclass: groupofnames
    cn: hrpeople
    description: Human Resources group
    member: cn=Robert Smith,ou=people,dc=example,dc=com



How would we add further levels of nesting though?

ou='Projects' /
description: This top level group has a few people in it that can create new groups, and control who's in them
member: cn=Robert Smith,ou=people,dc=example,dc=com

    -- somethingsomethingAbitrarilyNestedGroup='project-name'
        member: cn=Robert Smith,ou=people,dc=example,dc=com

        -- groupOfNames = 'project-name development'
            member: cn=Robert Smith,ou=people,dc=example,dc=com
            member: cn=Jane Doe,ou=people,dc=example,dc=com
            member: cn=server1$,ou=servers,dc=example,dc=com

        -- groupOfNames = 'project-name staging'
            member: cn=Jane Doe,ou=people,dc=example,dc=com
            member: cn=server2$,ou=servers,dc=example,dc=com