<small id='pqQbB'></small><noframes id='pqQbB'>

<tfoot id='pqQbB'></tfoot>

    <i id='pqQbB'><tr id='pqQbB'><dt id='pqQbB'><q id='pqQbB'><span id='pqQbB'><b id='pqQbB'><form id='pqQbB'><ins id='pqQbB'></ins><ul id='pqQbB'></ul><sub id='pqQbB'></sub></form><legend id='pqQbB'></legend><bdo id='pqQbB'><pre id='pqQbB'><center id='pqQbB'></center></pre></bdo></b><th id='pqQbB'></th></span></q></dt></tr></i><div id='pqQbB'><tfoot id='pqQbB'></tfoot><dl id='pqQbB'><fieldset id='pqQbB'></fieldset></dl></div>
    • <bdo id='pqQbB'></bdo><ul id='pqQbB'></ul>

    1. <legend id='pqQbB'><style id='pqQbB'><dir id='pqQbB'><q id='pqQbB'></q></dir></style></legend>
    2. ASP.NET MVC:如何为 LDAP 身份验证设置 web.config?

      ASP.NET MVC: How to setup web.config for LDAP authentication?(ASP.NET MVC:如何为 LDAP 身份验证设置 web.config?)
      1. <small id='FD6oA'></small><noframes id='FD6oA'>

        • <tfoot id='FD6oA'></tfoot>

              <tbody id='FD6oA'></tbody>

            <legend id='FD6oA'><style id='FD6oA'><dir id='FD6oA'><q id='FD6oA'></q></dir></style></legend>
              <i id='FD6oA'><tr id='FD6oA'><dt id='FD6oA'><q id='FD6oA'><span id='FD6oA'><b id='FD6oA'><form id='FD6oA'><ins id='FD6oA'></ins><ul id='FD6oA'></ul><sub id='FD6oA'></sub></form><legend id='FD6oA'></legend><bdo id='FD6oA'><pre id='FD6oA'><center id='FD6oA'></center></pre></bdo></b><th id='FD6oA'></th></span></q></dt></tr></i><div id='FD6oA'><tfoot id='FD6oA'></tfoot><dl id='FD6oA'><fieldset id='FD6oA'></fieldset></dl></div>

                <bdo id='FD6oA'></bdo><ul id='FD6oA'></ul>

              • 本文介绍了ASP.NET MVC:如何为 LDAP 身份验证设置 web.config?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个使用这些参数的 LDAP 服务器:

                I have a working LDAP Server with these parameters:

                OU=users,OU=mydomain,O=this domain
                LDAP://myhost:389 
                

                成功使用通用 ldap 客户端访问,例如 Jarek Gawor 的 ldap 浏览器/客户端,具有以下设置:

                I successfully access with a generic ldap client, like the good Jarek Gawor's ldap browser/client with following settings:

                OU=users,OU=mydomain,O=this domain
                User info (append base DN):
                uid=myid
                password=mypwd
                

                我尝试使用 ASP.NET 进行相同的操作,但总是收到错误用户名或密码错误".你能帮我用上面的参数设置web.config吗?我做了很多尝试,比如更改连接用户名、删除域名、设置 uid=myid 等...

                I tried to to the same with ASP.NET, getting always the error "wrong username or password". May you help me to setup web.config with above parameters, please? I did many tries, like changing connectionUsername, removing domainname, putting uid=myid, etc...

                web.config

                <configuration>
                  <connectionStrings>
                  <add name="ADConnectionString" connectionString="LDAP://myhost:389"/>
                  ....
                
                <membership defaultProvider="DefaultMembershipProvider">
                  <providers>
                    <add name="DefaultMembershipProvider"
                         type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                         connectionStringName="ADConnectionString"
                         connectionProtection="None"
                         connectionUsername="MYDOMAINmyid"
                         connectionPassword="mypwd"
                         attributeMapUsername="sAMAccountName"
                         enableSearchMethods="True" />
                  </providers>
                </membership>
                ......
                

                提前致谢

                推荐答案

                我成功地使用了以下 web.config 设置.

                I succeeded in getting it work with the following web.config setup.

                有两个问题/错误:

                1st)我没有指定容器,所以我按照@Kevin的提示:

                1st) I did not specify the container, so I followed @Kevin's hints:

                <configuration>
                  <connectionStrings>
                  <add name="ADConnectionString" connectionString="LDAP://myhost:389/O=this domain,CN=Users,DC=mydomain,DC=com"/>
                  ....
                

                我认为这与 CN 相关,而 O 可以在这里省略,但我认为这不是很重要...

                I think that was relevant the CN, while O could be omitted here, but I do not think this is very important...

                2nd)我将 DN 基础和用户名(以 uid= 形式)放在 connectionUsername 参数中:

                2nd) I put the DN base and username (in the form uid=) together inside connectionUsername parameter:

                <membership defaultProvider="DefaultMembershipProvider">
                  <providers>
                <add name="DefaultMembershipProvider"
                     type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                     connectionStringName="ADConnectionString"
                     connectionProtection="None"
                     connectionUsername="uid=myid, O=this domain"
                     connectionPassword="mypwd"
                     attributeMapUsername="sAMAccountName"
                     enableSearchMethods="True" />
                

                请注意,在我的情况下,我需要输入 uid=myid.我不知道这是否是一个通用的解决方案;可能和我公司的ADAS配置有关,我不知道.我希望这可以帮助你们中的一些人......如果你觉得这个解决方案有用,请投票,谢谢.

                Please note, in my case I needed to put uid=myid. I do not know if this could be a general solution; perhaps it is related to ADAS configuration of my company, I do not know. I hope this can help some of you...please vote up if you find this solution useful, thx.

                @Kevin:非常感谢.你帮了大忙!

                @Kevin: Thank you very much. You have been very helpful!

                这篇关于ASP.NET MVC:如何为 LDAP 身份验证设置 web.config?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Adding headers in ASP.NET MVC 3(在 ASP.NET MVC 3 中添加标头)
                Response.Redirect strips Header Referrer - Possible to Add it Back?(Response.Redirect 剥离 Header Referrer - 可以将其添加回来吗?)
                Faking browser request in ASP.net C#(在 ASP.net C# 中伪造浏览器请求)
                How to delete IIS custom headers like X-Powered-By: ASP.NET from response?(如何从响应中删除 IIS 自定义标头,例如 X-Powered-By: ASP.NET?)
                What does vary:accept-encoding mean?(变化:接受编码是什么意思?)
                Cache-control: no-store, must-revalidate not sent to client browser in IIS7 + ASP.NET MVC(缓存控制:在 IIS7 + ASP.NET MVC 中,没有存储、必须重新验证未发送到客户端浏览器)
              • <legend id='MoBgm'><style id='MoBgm'><dir id='MoBgm'><q id='MoBgm'></q></dir></style></legend>
              • <i id='MoBgm'><tr id='MoBgm'><dt id='MoBgm'><q id='MoBgm'><span id='MoBgm'><b id='MoBgm'><form id='MoBgm'><ins id='MoBgm'></ins><ul id='MoBgm'></ul><sub id='MoBgm'></sub></form><legend id='MoBgm'></legend><bdo id='MoBgm'><pre id='MoBgm'><center id='MoBgm'></center></pre></bdo></b><th id='MoBgm'></th></span></q></dt></tr></i><div id='MoBgm'><tfoot id='MoBgm'></tfoot><dl id='MoBgm'><fieldset id='MoBgm'></fieldset></dl></div>

                    1. <tfoot id='MoBgm'></tfoot>

                          <tbody id='MoBgm'></tbody>

                        <small id='MoBgm'></small><noframes id='MoBgm'>

                          <bdo id='MoBgm'></bdo><ul id='MoBgm'></ul>