ASP.NET MVC中的Active Directory身份验证 [英] Active directory authentication in ASP.NET MVC

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

问题描述

我是Active Directory身份验证的新手。需要使用活动目录创建登录。请帮助我解释示例或链接,我可以学习创建活动目录登录





<身份验证模式=  表单 >  
< forms name = 。ADAuthCookie loginUrl = 〜/ Account / LogOn timeout = 15 slidingExpiration = false protection = 全部 />
< / 身份验证 >
< membership defaultprovider = MY_ADMembershipProvider >
< providers>
< clear />
< add name = MY_ADMembershipProvider type = System.Web.Security.ActiveDirectoryMembershipProvider connectionstringname = ADService attributemapusername = sAMAccountName />
< / 提供商 >
< / 成员资格 >





我的尝试:



http://www.code.colostate.edu/active-directory-authentication-in-aspnet-mvc-5.aspx



http: //www.benramey.com/2014/10/20/active-directory-authentication-in-asp-net-mvc-5-with-forms-authentication-and-group-based-authorization/

解决方案

您需要从表单切换到Windows身份验证并拒绝匿名用户。



 <  配置 >  
< system.web >
< authentication mode = Windows / >
< span class =code-keyword><
授权 >
< deny 用户 = / >
< / authorization >
< / system.web >
< / configuration >





这应该在用户访问系统时打开一个登录窗口。



有一个全面的列表有关模式和实践网站的示例:

如何:使用Windows身份验证在ASP.NET 2.0中 [ ^


I am new for Active Directory authentication. Need to create login using active directory. Please help me with explained example or link where i can learn to create active directory login



<authentication mode="Forms">
      <forms name=".ADAuthCookie" loginUrl="~/Account/LogOn" timeout="15" slidingExpiration="false" protection="All" />
    </authentication>
    <membership defaultprovider="MY_ADMembershipProvider">
      <providers>
        <clear />
        <add name="MY_ADMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider" connectionstringname="ADService" attributemapusername="sAMAccountName" />
      </providers>
    </membership>



What I have tried:

http://www.code.colostate.edu/active-directory-authentication-in-aspnet-mvc-5.aspx

http://www.benramey.com/2014/10/20/active-directory-authentication-in-asp-net-mvc-5-with-forms-authentication-and-group-based-authorization/

解决方案

You'll want to switch from forms to windows authentication and deny anonymous users.

<configuration>
  <system.web>
    <authentication mode="Windows"/>
    <authorization>
        <deny users="?"/>
    </authorization>
  </system.web>
</configuration>



This should open a login window when users access the system.

There's a comprehensive list with examples on the patterns and practices site at:
How To: Use Windows Authentication in ASP.NET 2.0[^]


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

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