为什么 Windows 身份验证使用错误的用户名?

发布于 2024-09-28 03:09:03 字数 544 浏览 0 评论 0原文

我们有一个使用 Windows 身份验证连接到 SQLServer 数据库的 ASP 站点。该网站共有三个实例,一个开发环境(位于我的工作站上)、一个 UAT 环境和一个生产环境,它们位于不同的服务器上。

当我访问开发站点(使用与 UAT 站点相同的数据库)时,没有任何问题,该站点使用我的 Windows 帐户连接到数据库。但是,当我连接到 UAT 站点时,它使用另一个帐户(属于我但未连接到我的默认 Windows 登录名),该帐户在数据库上没有权限,因此该站点返回以下错误:

用于 SQL 的 Microsoft OLE DB 提供程序 服务器错误“80004005” 无法打开登录“ANAAML”中请求的数据库。登录失败。
/inc/dbconnect.asp,第 4 行

Dev 和 UAT 站点上的 ASP 文件是相同的,因此任何人都可以解释为什么 UAT 站点可能使用不正确的 Windows 帐户吗?这只会影响所有工作站的我,不会影响其他用户。

已重新启动服务器和我的工作站,并在本地清除我的互联网文件。

We have an ASP site using Windows authentication to connect to a SQLServer database. There are three instances of the web site, a Dev environment (located on my Workstation), an UAT environment and a production environment, which are on separate servers.

When I access the Dev site (which uses the same DB as the UAT site) I have no issues, the site connects to the database using my Windows account. However when I connect to the UAT site, it uses a different account (one which belongs to me but is not connected to my default Windows login) which is not permissioned on the DB, so the site returns the following error:

Microsoft OLE DB Provider for SQL
Server error '80004005'
Cannot open database requested in login 'ANAML'. Login fails.
/inc/dbconnect.asp, line 4

The ASP files on the Dev and UAT sites are identical, so can anyone explain why the UAT site might be using the incorrect Windows account? This only affects me, from all workstations, and no other users.

Have rebooted the server and my workstation, and cleared my internet files locally.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

丑疤怪 2024-10-05 03:09:03

I found the answer at this page on ServerFault. Seems the login details for the UAT server had been stored in the Users control panel at some point. Deleting the relevant entry in the control panel restored the correct login when connecting to the website.

人间☆小暴躁 2024-10-05 03:09:03

好吧,我的 ASP 知识已经基本消失了,但我会看看我的大脑会想到什么。我的第一个想法是虚拟目录安全性在发生故障的服务器上的配置不同。听起来您只需要将其设置为“集成 Windows 身份验证”。

如果设置正确,那么我会询问您的连接字符串。您的连接字符串是否指定可信连接(例如,它不指定用户名和密码)?

ANAAML 账户从哪里来?是仅 SQL 登录还是 Windows 帐户?

Well, my ASP knowledge has mostly faded but I'll see what comes out of my brain. My first thought would be that the Virtual Directory security is configured differently on the server where it is failing. It sounds like you would need it to be set to "Integrated Windows Authentication" only.

If that is set correctly then I'd ask about your connection string. Does your connection string specify Trusted Connection (e.g. it does not specify a username and password)?

Where does the ANAML account come from? Is it a SQL only login or is it a windows account?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文