LDAP 用户和 Web 应用程序 [英] LDAP users and web application

查看:31
本文介绍了LDAP 用户和 Web 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们构建了一个 Web 应用程序(在我们的 Intranet 上运行),该应用程序依赖于我们的 LDAP 目录(活动目录)为其用户提供服务.我们使用 LDAP 目录,就像使用数据库一样,而不是使用我们的应用程序数据库 (MySQL) 中的用户"表来同步"目录用户.

We built a web application (running on our intranet) that relies on our LDAP directory (active directory) for it's users. Instead of 'syncing' the directory users with say a 'user' table in our application database (MySQL) we use the LDAP directory just like we use databases.

在从 MySQL 拉取的实体和 LDAP 用户之间创建关系时,我们使用用户 GUID(这是一个唯一字符串).

When creating a relation between an entity pulled from MySQL and an LDAP user we use the user GUID (which is a unique string).

我们的目录永远不会有超过 300 个用户(永远不会).我们安装了一个专用的 DC(域控制器)来满足我们的应用程序请求.网络延迟不是问题.

Our directory will never have more than 300 users (never). We installed a dedicated DC (Domain Controller) to serve our application request. Network latency is not an issue.

在我们的代码中,我们可以替换几行代码以从使用 LDAP 切换到使用 MySQL 和用户"表(数据映射器很棒)

In our code we could replace a few lines of code to switch from using LDAP to using MySQL and a 'user' table (data mappers are awesome)

您会这样做吗(没有用户"表同步)?您对此有何反对意见(这样做的方式)?

Would you do this (no 'user' table syncing)? What are your arguments against this (way of doing it)?

编辑

我们确实使用了用户"表,但它非常简单,所以 sql 连接并不是真正的问题,我们知道使用 完整 用户表会具有更好的性能但正在寻找其他反对使用 LDAP 的论据

We do use a 'user' table but it's very simple so sql joins are not really a problem, we know it will have better perfomance with a full user table but are looking for other arguments against using LDAP

CREATE TABLE `user` (
    `_id` int(4) unsigned NOT NULL AUTO_INCREMENT,
    `guid` varchar(255) NOT NULL,
    PRIMARY KEY (`_id`)
);

推荐答案

我不会这样做.我会在每次登录时同步用户数据,但密码除外.这样,您就可以在其数据库中获得应用程序的当前数据,并且可以使用数据库连接功能来获取所有相关信息,而无需查询不同的系统.我只会使用 LDAP 进行身份验证,也许还会使用基于 LDAP-Group 的授权模型.

I would not do it. I would sync the users data except for the password on every login. That way you have the current data of your application in its database and you can use your databases join features to get all the relevant information without going to query different systems. I'd only use LDAP for authentication and perhaps a model of LDAP-Group based authorization.

  • 这样您就无需为密码和任何密码而烦恼政策.
  • 登录后,您将完全独立于 LDAP 服务器.
  • 缺少 LDAP 服务器不会影响已经登录的用户,只有新用户登录将不起作用.

即使 objectGUID 是唯一的,它在您的 LDAP 中也是唯一的,不一定是您的应用程序.

And even though the objectGUID is unique it is unique throughout your LDAP and not necessarily your application.

我们经常遇到的问题是,在 LDAP 中,当用户名更改(由于结婚或离婚)时,我们新创建了一个用户而不是重命名.但在这种情况下,您可能不想在您的应用中创建新用户.使用您自己的用户表,您可以简单地更改用户的 ObjectGUID,用户应用程序内部 ID 保持不变,但链接到 LDAP 中的全新用户.

We often have the issue that in LDAP a user us newly created instead of renamed when the users name changes (due to marriage or divorce f.i.). But you might not want to create a new user in that case in your app. With your own users table you can simply change the ObjectGUID for a user and the users app-internal id stays the same but links to a completely new user in LDAP.

这篇关于LDAP 用户和 Web 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆