简体   繁体   English

Windows Server 2008,IIS7和Windows身份验证

[英]Windows Server 2008, IIS7 and Windows Authentication

We currently have a development server set up which we are trying to test some Windows authentication ASP.NET code on. 当前,我们已经设置了一个开发服务器,我们正在尝试测试一些Windows身份验证ASP.NET代码。

We have turned on Windows Authentication in IIS7 on Windows Server 2008 R2 fine, and it asks the user for a username and password as excepted, but the problem is it doesn't appear to accept any credentials. 我们已经在Windows Server 2008 R2的IIS7中很好地启用了Windows身份验证,它要求用户输入用户名和密码(例外),但问题是它似乎不接受任何凭据。 This code for example... 这段代码例如...

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Page.Title = "Home page for " + User.Identity.Name
End Sub

...always returns an empty string. ...总是返回一个空字符串。

One theory we have is that we dont have Active Directory installed as of yet, we are just testing this by logging on via the machine name not a domain. 我们有一个理论,就是到目前为止尚未安装Active Directory,我们只是通过通过计算机名而不是域进行登录来进行测试。

Is this type of authentication only applicatable to domains (if so we can probably install Active Directory and some test accounts) - or is it possible to get the user identity when logging in using the machine name? 这种身份验证是否仅适用于域(如果可以,那么我们可以安装Active Directory和一些测试帐户)-或使用计算机名登录时是否可以获取用户身份?

Ideally we would like to be able to test this on our local machines (Windows 7 Pro) using our own accounts (again these aren't on a domain) and IIS but this has the same issue as our dev server. 理想情况下,我们希望能够使用我们自己的帐户(同样,这些帐户不在域中)和IIS在本地计算机(Windows 7 Pro)上进行测试,但这与我们的开发服务器存在相同的问题。

** Note I have asked this on serverfault as well, but I think this question crosses both the server and programming line. **注意,我也曾在serverfault上问过这个问题,但我认为这个问题同时涉及服务器和编程领域。 ** **

Thanks, 谢谢,

Finally figured it out by playing around. 终于通过玩弄弄清楚了。 If any one is interested here is what I did... 如果有人对此感兴趣,那是我所做的...

On Windows Server 2008 I opened up the 'Edit Local Users and Groups' policy. 在Windows Server 2008上,我打开了“编辑本地用户和组”策略。 I added a new user for the client. 我为客户端添加了一个新用户。 Then in IIS I set the authentication to Windows Authentication only, then I opened the 'IIS Manager Permissions' and added the new user and my self. 然后在IIS中,将身份验证设置为“仅Windows身份验证”,然后打开“ IIS管理器权限”并添加新用户和我自己。

Not quite sure if this is the exact way to go about it but it seems to work for us. 不太确定这是否是解决问题的确切方法,但似乎对我们有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM