"用户登录失败''"尝试使用Windows身份验证时 [英] "Login failed for user ''" when trying to use Windows Authentication

查看:108
本文介绍了"用户登录失败''"尝试使用Windows身份验证时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的ASP.NET的web.config我的连接字符串:

On my ASP.NET web.config I have the connection string:

initial catalog=DatabaseName; data source=(local); Integrated Security=SSPI;MultipleActiveResultSets=True; Connect Timeout=200;

我以前使用Windows身份验证此连接字符串,但现在我发现了错误:

I've used this connection string for Windows Authentication before, but now I'm getting the error:

Login failed for user ''.

这似乎是它的一个SQL身份验证错误,而我还没有提供任何用户名或密码的用户名是空白的。

This seems like its a SQL Authentication error, and that the username is blank as I have not supplied either a username or password.

为什么应用程序尝试SQL身份验证和非Windows?

Why is the application attempting SQL Authentication and not Windows?

我怎样才能解决这个问题?

How can I resolve this issue?

推荐答案

有关您的连接字符串从ASP.NET应用程序的工作,你的请求必须在可以访问SQL Server的用户身份运行。默认情况下,它会使用应用程序池的工作进程的身份和普遍,这个身份是本地用户(在服务器上)不具有访问SQL Server。所以,你可以尝试改变这个身份,看看是否能帮助。

For your connection string to work from ASP.NET application, your request must be running under user identity that can access SQL Server. By default, it will use identity of app pool worker process and generally, this identity is a local user (on the server) that does not have access to SQL Server. So you may try changing this identity to see if that help.

如果你想使用正在访问你的ASP.NET站点,那么你已经转集成的IIS和AS​​P.NET两种身份验证的Windows用户的身份。您还需要打开 ASP.NET模拟使ASP.NET请求将执行用户的身份。

If you want to use identity of the windows user that is accessing your ASP.NET site then you have turn integrated authentication on in both IIS and ASP.NET. You also need to turn on the ASP.NET impersonation so that ASP.NET request will execute on the user's identity.

如果您仍遇到问题,那么你可能会面临<一个href=\"http://weblogs.asp.net/owscott/archive/2008/08/22/iis-windows-authentication-and-the-double-hop-issue.aspx\"相对=nofollow>双跃点问题涉及到Windows身份验证(请参阅文章以获得更多信息和故障排除在看见两个链接)。

If you are still facing the issue then you might be facing double hop issue related to windows authentication (see two links sighted in the article for more info and trouble shooting).

这篇关于&QUOT;用户登录失败''&QUOT;尝试使用Windows身份验证时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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