如何从 ASP.NET Web 服务代码对 Active Directory 进行身份验证?

How do I authenticate against Active Directory from ASP.NET web service code?(如何从 ASP.NET Web 服务代码对 Active Directory 进行身份验证?)
本文介绍了如何从 ASP.NET Web 服务代码对 Active Directory 进行身份验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有几个工作网站位于公司 LAN 之外——因此不在 Active Directory (A/D) 的直接通信范围内——但我希望能够对其进行身份验证用户针对公司 A/D 服务器以及用户/角色的辅助存储库***.这个活动的伪代码是这样的:

I have a few websites for work that live outside of the corporate LAN -- and, therefore, out of direct-communication range of Active Directory (A/D) -- but for which I would like to be able to authenticate users against the corporate A/D servers as well as a secondary repository of users/roles***. The pseudo code for this activity is this:

  1. 用户在外部网站的登录表单中输入用户名/密码.
  2. 外部网站调用 LAN 内部可以与 A/D 通信的网络服务.
  3. Web 服务会检查用户名/密码是否可以通过身份验证映射到 A/D 中的用户.如果是,则返回用户所属的 A/D 角色列表.
  4. 如果无法找到用户名/密码/针对 A/D 进行身份验证,请检查作为用户/角色信息的辅助存储库的数据库/服务.如果它们通过辅助身份验证服务器进行身份验证,则返回用户所在的所有角色.
  5. 将用户所处的角色列表返回到调用网站.

*** 这个想法是我们不希望将数十个——可能是数百个——承包商和附属机构放入 Active Directory,因为他们只会登录到我们的外部 Web 服务器.因此采用了二级身份验证方案.

*** The idea is that we don't want to put dozens -- potentially hundreds -- of contractors and affiliates into Active Directory when all they will only be logging into our external web servers. Hence the secondary auth scheme.

推荐答案

您可能想看看@这两个资源.第一个将为您提供您想了解的有关 Active Directory 的所有信息,第二个将向您展示如何连接.

You might want to take a look @ these two resources. The first will provide you with everything you want to know about active directory, and the second will show you how to connect.

  • http://www.codeproject.com/KB/system/everythingInAD.aspx
  • http://msdn.microsoft.com/en-us/library/aa302397.aspx

不过,您可能会遇到连接到远程 AD 服务器的挑战.因此,作为一种潜在的解决方法,我会考虑让 Web 应用程序调用驻留在公司网络上的身份验证 Web 服务.

You might have challenges connecting to the remote AD server though. So as a potential work around, I would consider having the web application call an authentication webservice that resides on the corporate network.

这篇关于如何从 ASP.NET Web 服务代码对 Active Directory 进行身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Finding Active Directory users from 2 OU(从 2 个 OU 中查找 Active Directory 用户)
How to set a binary attribute when using a AccountManagement Extension Class?(使用 AccountManagement 扩展类时如何设置二进制属性?)
How to check AD user credentials when the user password is expired or quot;user must change password at next logonquot;(如何在用户密码过期或“用户下次登录时必须更改密码时检查 AD 用户凭据)
Getting last Logon Time on Computers in Active Directory(在 Active Directory 中的计算机上获取上次登录时间)
customer-configurable asp.net web site security for fine-grained control of page and button access(客户可配置的 asp.net 网站安全性,用于对页面和按钮访问进行细粒度控制)
Active Directory - Roles of a user(Active Directory - 用户的角色)