简体   繁体   English

Windows中Node.JS的LDAP授权

[英]LDAP Authorization for Node.JS in Windows

I'm trying to build a Node.JS project that takes advantage of LDAP authorization so that existing user authentication information can be used. 我正在尝试构建一个利用LDAP授权的Node.JS项目,以便可以使用现有的用户身份验证信息。 The catch is that all our machines are Windows machines. 问题是我们所有的机器都是Windows机器。 All the solutions I've found so far (node-LDAP, ldapjs, ldapauth, etc) are built for Linux, and npm install [some_package] fails on Windows. 到目前为止,我发现的所有解决方案(node-LDAP,ldapjs,ldapauth等)都针对Linux构建,而npm install [some_package]在Windows上失败。 More scrounging yielded complicated solutions or required building Node.JS packages from Python/C++ source locally, which starts getting messy and leads to dependency hell, as in this solution: 越来越复杂的解决方案产生了复杂的解决方案,或者需要从Python / C ++源代码本地构建Node.JS程序包,这开始变得混乱并导致依赖地狱,如以下解决方案所示:

http://tochedev.blogspot.be/2012/07/i-wanted-to-add-ldapjs-to-my-windows.html http://tochedev.blogspot.be/2012/07/i-wanted-to-add-ldapjs-to-my-windows.html

Kudos to the author for putting that effort in and publishing his path to success but if that level of complexity is required in dependency, then the solution isn't appropriate for my application. 感谢作者付出这一努力并发表他的成功之路,但是如果依赖性需要这种复杂性,那么该解决方案不适合我的应用程序。

That leaves me with limited options: redesign architecture around a Linux VM just so I can have LDAP authentication, which isn't much simpler than the linked solution above; 这给我留下了有限的选择:重新设计架构围绕Linux的虚拟机只是这样我就可以有LDAP身份验证,这是不是比上面链接的解决方案更简单; abandon entire Node.JS project and do everything in another language just to support LDAP; 放弃整个Node.JS项目,并以另一种语言来完成所有工作,以支持LDAP; dive into dependency hell just so I can have LDAP authentication; 进入依赖地狱以便我可以进行LDAP身份验证; give up on LDAP authentication. 放弃LDAP身份验证。 I would love there to be a fourth option, a straightforward method of LDAP authentication in Node.JS for Windows, but I haven't found one so far. 我希望有第四个选择,一种用于Windows的Node.JS中的LDAP身份验证的直接方法,但是到目前为止我还没有找到。 Now I've spent enough time searching that I'm ready to beg for help. 现在,我已经花了足够的时间搜索,随时可以寻求帮助。

Sorry if this question is on the wrong StackExchange, I'll repost if necessary, didn't know exactly where it fit. 抱歉,如果问题在错误的StackExchange上,我会在必要时重新发布,不知道确切的位置。

In my experience, there aren't a lot of good ldap tools for node (period). 以我的经验,没有很多用于节点(周期)的ldap工具。 One of the alternatives is using something like Stormpath to handle this. 替代方法之一是使用Stormpath之类的方法来解决此问题。 Basically, you'd have to create a Stormpath account, run their LDAP agent, and they'll basically sync your LDAP accounts into their REST API which you can then access via their Node libraries . 基本上,您必须创建一个Stormpath帐户,运行其LDAP代理,并且他们基本上会将LDAP帐户同步到其REST API中,然后可以通过其Node库进行访问。

This is a nice way to do it as you can interact with the LDAP accounts using a simple Node library, without needing to talk to your LDAP server directly. 这是一种很好的实现方式,因为您可以使用简单的Node库与LDAP帐户进行交互,而无需直接与LDAP服务器对话。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM