简体   繁体   English

使用ASP从Active Directory获取当前登录的用户凭据

[英]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.

相关问题 当非管理员用户在管理面板中登录时,如何隐藏一些导航栏页面? - How can I hide some navbar pages when a non-admin user is logged-in in the admin panel? Symfony2:如何通过考虑当前登录用户来验证实体? - Symfony2: How to validate an entity by taking into account the currently logged in user? 如何登录用户无状态Bean - How to get logged in user stateless bean 如何在 oim 请求数据验证中获取登录的用户详细信息? - How to get logged in user details in oim request data validation? 确保用户已登录 - Ensuring the user is logged in 如何在母版页弹出窗口的向导中从User Control中获取ControlToValidate ID-javascript asp.net验证 - How to get ControlToValidate ID from User Control in a wizard in a popup in a master page - javascript asp.net validation 使用PHP和mysql时如何检查普通用户或管理员用户是否登录? - How to check if normal user or admin user is logged in when using PHP and mysql? 通过用户名检查用户是否登录 django - Check if user is logged in or not django by username 如何通过其中一个属性的值使用反射来获取属性名称,或者如何获取当前正在验证的数据属性的属性信息? - How to get property name by one of it's attributes' value using reflection or how to get property info of data property which is currently validating? 为登录用户处理 django 中的表单字段 - Handling form fields in django for logged in user
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM