没有登录表单Active Directory身份验证 [英] Active Directory authentication without Login form

查看:149
本文介绍了没有登录表单Active Directory身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我的用户进行身份验证对Active Directory,但没有任何登录表单。

I want to authenticate my Users to Active Directory but without any login form.

我只是想打开我的默认页面,如果用户登录到计算机属于Active Directory中。

I just want open my default page if user logged in to machine belongs to Active Directory.

首先,我用Windows身份验证,但有来验证谁属于其他域中有多个域用户的要求。

Firstly, i used Windows Authentication but there is a requirement to authenticate user who belong to other domain as there are more than one domain.

推荐答案

有关这一点,你需要使用 System.DirectoryServices.AccountManagement 命名空间。随着启用Windows身份验证,您需要写在你的默认页面的的Page_Load 事件验证code。如果用户是必需的域的一部分,对其进行识别并显示他的页面。否则,告诉他,他没有访问权限。

For this, you need to use the System.DirectoryServices.AccountManagement namespace. Along with enabling Windows authentication, you need to write the authentication code in the Page_Load event of your default page. If the user is part of the required domain, authenticate him and show him the page. Otherwise, tell him that he doesn't have access.

这<一个href=\"http://stackoverflow.com/questions/4453801/check-userid-exists-in-active-directory-using-c-sharp\">answer应该让你去。

这篇关于没有登录表单Active Directory身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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