使用Active Directory进行身份验证 [英] Authentication using active directory

查看:117
本文介绍了使用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应用程序会自动使用它,而网络应用程序(可以在https://forums.asp.net上发布)只需将
的身份验证设置为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 https://forums.asp.net) 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进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆