[英]Get currently logged-in user credentials from Active Directory using ASP
I would love to just use C# and be done with it, but the environment I'm working in blocks every scripting language except Active Server Pages (classic ASP). 我希望只使用C#并完成它,但是我正在使用的环境会阻塞除Active Server Pages(经典ASP)之外的所有脚本语言。 I've found several resources describing how one can validate Active Directory user credentials by querying specific username and password fields against AD.
我发现了一些资源,它们描述了如何通过针对AD查询特定的用户名和密码字段来验证Active Directory用户凭据。 But the app I'm building will be running inside of an environment where the user's credentials have already been validated (in general) and they are already "logged in."
但是我正在构建的应用程序将在环境中运行,该环境中的用户凭据已经(通常)已经过验证,并且已经“登录”。 So, I really need a way to capture the credentials of the logged-in user and compare them against a predefined list of approved user credentials (to allow special access without requiring additional login steps).
因此,我确实需要一种方法来捕获已登录用户的凭据,并将它们与已批准的用户凭据的预定义列表进行比较(以允许进行特殊访问而无需其他登录步骤)。
Is there any way to do this? 有什么办法吗?
ASP Login example I've found: http://bytes.com/topic/asp-classic/answers/126267-asp-active-directory 我发现了ASP登录示例: http : //bytes.com/topic/asp-classic/answers/126267-asp-active-directory
Thanks in advance! 提前致谢!
You can pull the user's name from the Request.ServerVariables("AUTH_USER")
server variable. 您可以从
Request.ServerVariables("AUTH_USER")
服务器变量中提取用户名。
The only thing you need to ensure is that the security settings are correct on IIS. 您唯一需要确保的是在IIS上正确设置安全性。 If you're using IIS5 or 6 then you can do this by right clicking the web-site in IIS, switch to Directory Security , edit the authentication and access control and tick only the Integrated Windows authentication option.
如果您使用的是IIS5或6,则可以通过右键单击IIS中的网站,切换到“ 目录安全性” ,编辑身份验证和访问控制并仅选中“ 集成Windows身份验证”选项来执行此操作。
In IIS 7 and above, expand to your web-site, then edit the settings under the IIS settings section, enabling only Windows Authentication . 在IIS 7及更高版本中,展开到您的网站,然后在IIS设置部分下编辑设置,仅启用Windows身份验证 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.