将域添加到默认的登录控件,并将其与活动目录一起使用 [英] Add the Domain filed to default Login control and using it with active directory

查看:92
本文介绍了将域添加到默认的登录控件,并将其与活动目录一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我使用.net登录控件获得了一个登录页面,该控件可以在我的Intranet网络上正常工作.

Hi All, I got a Login page, using the .net login control that work correctly on my intranet network.

<asp:Login ID="LoginUser" runat="server" EnableViewState="false"

       RenderOuterTable="false" DisplayRememberMe="False">
       <LayoutTemplate>
           <table cellpadding="1" cellspacing="0" style="border-collapse:collapse;">
               <tr>
                   <td>
                       <table cellpadding="0">
                           <tr>
                               <td align="center" colspan="2">
                                   Log In</td>
                           </tr>
                           <tr>
                               <td align="right">
                                   <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label>
                               </td>
                               <td>
                                   <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                                   <asp:RequiredFieldValidator ID="UserNameRequired" runat="server"

                                       ControlToValidate="UserName" ErrorMessage="User Name is required."

                                       ToolTip="User Name is required." ValidationGroup="LoginUser">*</asp:RequiredFieldValidator>
                               </td>
                           </tr>
                           <tr>
                               <td align="right">
                                   <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                               </td>
                               <td>
                                   <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                                   <asp:RequiredFieldValidator ID="PasswordRequired" runat="server"

                                       ControlToValidate="Password" ErrorMessage="Password is required."

                                       ToolTip="Password is required." ValidationGroup="LoginUser">*</asp:RequiredFieldValidator>
                               </td>
                           </tr>
                                                       <tr>
                               <td align="right">
                                   <asp:Label ID="DomainLabel" runat="server" AssociatedControlID="Domain">Domain:</asp:Label>
                               </td>
                               <td>
                                   <asp:TextBox ID="Domain" runat="server"></asp:TextBox>
                                   <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"

                                       ControlToValidate="Domain" ErrorMessage="Domain is required."

                                       ToolTip="Domain is required." ValidationGroup="LoginUser">*</asp:RequiredFieldValidator>
                               </td>
                           </tr>
                           <tr>
                               <td align="center" colspan="2" style="color:Red;">
                                   <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
                               </td>
                           </tr>
                           <tr>
                               <td align="right" colspan="2">
                                   <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In"

                                       ValidationGroup="LoginUser" />
                               </td>
                           </tr>
                       </table>
                   </td>
               </tr>
           </table>
       </LayoutTemplate>
   </asp:Login>





由于我们的网络中存在不同的域,因此如何使用domain字段在特定域上登录用户?
提前谢谢...
如果有人可以将我重定向到示例...我将为这个小问题而疯狂!! X |





since we have different domains in our network, how can use the domain field to login user on specific domain?
Thanks in advance...
if someone can redirect me to an example...I''m gonna to be crazy for this little problem!! X|

推荐答案

是否要用所有可用域预填充域字段?这将要求从服务器所在的域开始,在AD中遍历信任链.这可能很复杂.您也可以在dns链中查询_mscds记录,但这听起来很困难,而且如果可行,可能会返回假阳性(不信任且不在林中的域).如果您仍然有netbios名称,则也可以查询wins服务器中的PDC,但这当然不是一个具有前瞻性的解决方案.
如果不需要预填充,只需向用户询问域名,然后加上反斜杠和用户名,然后让操作系统来完成即可.
用户还可以通过输入userid@domain.whatever登录,操作系统将找到它的子级.
这是否回答了您的问题,还是我误会了某些内容?
Do you want to pre-fill your domain field with all available domains? This will require walking the trust chain in AD, starting from the domain in which the server is a member. This may be complicated. You could also query the dns chain for _mscds records, but this sounds iffy, and if it works, may return false positives (domains that have no trust, and are not in the forest). If you still have netbios names, querying the wins server for PDC''s might also work, but of course this is not really a forward-looking solution.
If pre-filling is not necessary, just ask the user for the domain name, append a backslash and the username, and let the OS do it''s thing.
Users may also login by giving their userid@domain.whatever, and the Operating System will find it''s children.
Does this answer your question, or have I misunderstood something?


这篇关于将域添加到默认的登录控件,并将其与活动目录一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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