使用Active Directory进行身份验证

编程入门 行业动态 更新时间:2024-10-28 12:20:06
本文介绍了使用Active Directory进行身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好,

我想验证用户身份我的项目使用活动目录,花了几个小时在互联网上冲浪后我没有发现任何对我有用的东西。

I want to authenticate users in my project using active directory, after hours and hours spent surfing on the internet i didn't find anything useful for me.

如果有人可以帮我处理代码或示例我会非常感激,因为我不知道从哪里开始。

If anyone can help me with pieces of code or example i'll appreciate it a lot, because i have no idea where i can start from.

祝你好运,

Leo

推荐答案

Perhap我不明白你的意思使用AD,但如果您只是想使用Windows身份验证(这是AD是什么),那么你不需要愿意做任何事情。 Windows应用程序会自动使用它,而网络应用程序(可以在forums.asp上发布)只需将的身份验证设置为Windows。您无需编写任何代码来验证当前用户。

Perhap I don't understand what you mean by use AD but if you simply want to use Windows auth (which is what AD is) then you don't need to do anything. Windows apps use it automatically and web apps (which can be posted at forums.asp) just set the authentication to Windows. You don't need to write any code to authenticate the current user.

要访问当前Windows用户,您可以根据应用程序使用各种方法,但WindowsIdentity.GetCurrent可以使用任何地方。在其他情况下,您可以使用当前线程的主体,因为它将设置为运行应用程序的用户。

To get access to the current Windows user you can use a variety of approaches depending upon your app but WindowsIdentity.GetCurrent works anywhere. In other cases you can use the current thread's principal since it will be set to the user running the app.

更多推荐

使用Active Directory进行身份验证

本文发布于:2023-11-14 08:52:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1586764.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:身份验证   Active   Directory

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!