更改Web应用程序的身份验证使用Windows身份验证 [英] change web application authentication to use Windows Authentication

查看:151
本文介绍了更改Web应用程序的身份验证使用Windows身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将发布IIS 8.5我的web应用程序,但是,当应用程序试图从SQL Server 2008中检索数据,我得到这个错误

I'm trying to publish my web application on IIS 8.5, but I'm getting this error when the application tries to retrieve data from the SQL Server 2008.

的InnerException:{消息:发生错误,ExceptionMessage:用户登录失败'域名\\ WES-JXC2J02 $',...}
ExceptionMessage:用户登录失败'域名\\ WES-JXC2J02 $'。

InnerException: {Message:An error has occurred., ExceptionMessage:Login failed for user 'domainname\WES-JXC2J02$'.,…} ExceptionMessage: "Login failed for user 'domainname\WES-JXC2J02$'."

在SQL Server没有WES-JXC2J02 $列为授权用户,因为这是我的dev的机器名。如果我尝试机器名称添加为用户在SQL Server它给了我一个错误,因为有域中没有这样的用户。我想用它设置在IIS中启用Windows身份验证。我能做些什么来解决这个问题?

The SQL Server doesn't have WES-JXC2J02$ listed as the authorized user because it's my dev machine name. If I try to add the machine name as user in SQL Server it gives me an error because there's no such user in the domain. I want to use Windows Authentication which is set to enable in IIS. What can I do to fix it?

推荐答案

所以,很显然,作为@MikeCheel说,这是我转发机器凭证到SQL Server检索数据库中的数据。事实证明,我需要建立在有限的访问SQL Server的一个新的登录,然后在ConnectionString添加用户ID和密码。我学会了坚硬方式,SQL Server必须有SQL并启用Windows身份验证。一旦被配置,连接了设置和数据正确显示。

So, apparently, as @MikeCheel said, it was forwarding my machine credentials to the SQL Server to retrieve the data from the database. Turned out, I needed to create a new login in SQL Server with limited access, then add the user id and password in the connectionString. I learnt it the hard way that SQL Server must have SQL and Windows Authentication enabled. Once that was configured, connection was setup and the data displayed properly.

这篇关于更改Web应用程序的身份验证使用Windows身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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