Requirements: In the domain synchronization function, all account information of the group or company can be obtained in the domain control server, and all users can be filtered and queried through the LDAP protocol.
LDAP stands for Lightweight Directory Access Protocol, which is a lightweight directory access protocol based on the TCP/IP protocol.
A directory is a database optimized for querying, browsing, and searching, organizing data in a tree-like structure, similar to a file directory.
Directory databases are different from relational databases in that they have excellent read performance but poor write performance, and do not have complex functions such as transaction processing and rollback, making them unsuitable for storing frequently modified data.
Get a domain via curl All the following user commands are as follows:
Review:
Create a new Maven project, introduce the basic packages of the Spring Boot framework, and then introduce itspring-boot-starter-data-ldappackage, as follows:
The basic configuration information of LDAP is configured in the application.yml configuration file, as follows:
willLdapTemplateRegistered to the IOC container, LdapTemplate's own encapsulation method performs CRUD operations on the Ldap database. The code is as follows:
All user information in the domain is queried through the LADP protocol, and the code is as follows:
The renderings are as follows:
Iterate through all element information for each user, the code is as follows:
Resources:
The hyperlink login is visible.
The hyperlink login is visible.
(End)
|