如何使用 spring 框架将 LDAP 数据添加到关系数据库 table 的查询数据中

How to add LDAP data into the queried data from relational database table using spring framework

我正在使用 SpringBoot 2.0 进行 Web 应用程序开发。关系数据库使用Spring Data JPA,LDAP使用Spring LDAP和Spring Data LDAP。

我的 Web 应用程序通过 LDAP 进行身份验证,授权是通过 Sql 服务器(关系数据库)进行的。

Web应用的认证授权没有问题

Sql服务器只能存储用户的ID(用于检索LDAP中的用户信息)。

但是,客户希望 Web 应用程序同时显示用户 ID 和用户名(只能通过 LDAP 检索)。

我使用 Spring 数据 JPA 从 sql 服务器获取 table 数据。而且我认为每次使用存储在 table 中的用户 ID 从 LDAP 检索用户名并不是一个好主意,以便通过硬编码添加用户名字段。

在 sql 服务器中查询 table 时,是否可以使用存储在 table 中的用户 ID 合并来自 ldap 的用户详细信息? (就像在关系数据库中连接多个 table)

SQL 服务器不能直接访问 LDAP。所以我需要一种方法在Spring框架中解决它。

如果你能给我一个解决方案,我将不胜感激。

When querying a table in SQL server, is there a way to combine user details from LDAP using the userid stored in the table? (Like joining multiple tables in a relational database)

只有 SQL 服务器对此有某种特殊支持,可能是通过存储过程等。

但是你说:

SQL Server does not have direct access to LDAP.

所以答案是否定的。