This article is a mirror article of machine translation, please click here to jump to the original article.

View: 12679|Reply: 3

[Source] Spring Boot obtains all users of the AD domain (LDAP).

[Copy link]
Posted on 11/30/2021 10:36:15 PM | | | |
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:

Linux tests LDAP connectivity using the Curl command
https://www.itsvse.com/thread-10177-1-1.html

LdapErr: DSID-0C09042A, comment: AcceptSecurityContext error, data 52e, v3839
https://www.itsvse.com/thread-10173-1-1.html

OpenLDAP custom objectclass and properties
https://www.itsvse.com/thread-9279-1-1.html

OpenLDAP Series (3) OpenLDAP commands are explained in detail
https://www.itsvse.com/thread-9276-1-1.html

OpenLDAP:Failed to start OpenLDAP Server Daemon.
https://www.itsvse.com/thread-9275-1-1.html

OpenLDAP Series (2) Centos 7 Installation OpenLDAP Tutorial
https://www.itsvse.com/thread-9274-1-1.html

OpenLDAP Series (1) Introduction to LDAP
https://www.itsvse.com/thread-9273-1-1.html

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)




Previous:Deploy the Discuz forum using Docker installation
Next:Spring Boot is based on AD domain (LDAP) authentication
Posted on 12/1/2021 4:40:15 PM |
Not bad..
Posted on 12/1/2021 4:43:09 PM |
Not bad...
Posted on 5/18/2023 3:58:26 PM |
Thanks for sharing, very useful!
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com