WCF 服务、Windows 身份验证
我们编写了一个WCF服务,部署在IIS上。我们选择集成 Windows 身份验证。在这种情况下无法使用服务,但如果我们可以将 WCF 服务的 IIS 虚拟目录的身份验证方法设置为“匿名”,那么错误就会消失。但我们的 WCF 服务不接受“匿名”。我们必须使用集成 Windows 身份验证来对客户端进行身份验证。有人知道如何解决这个问题吗?
预先感谢,
阿什什
we wrote a WCF service, deployed on IIS. we chose Integrated Windows Authentication. service can not be used in this case but if we can set the authentication method of the IIS virtual directory to "Anonymous" for WCF services, then the error will go away. But "Anonymous" is not acceptable for our WCF service. We have to use Integrated Windows Authentication to authenticate the client. Any one knows how to fix this problem?
Thanks in advance,
Ashish
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须做一些事情:
创建以下绑定配置:
将上述配置应用到您的服务和 mex:
创建客户端并使用 NetworkCredential 传递您的凭据:
还有其他方法可以设置用户名和密码。单独的密码,但它在.Net 4.0中不起作用。
USERACCOUNT 是您的 WCF 主计算机加入的域帐户或 LDAP。
如果服务器未加入域,则通过运行“lusrmgr.msc”在本地创建一个帐户
You have to do a few things:
Create the following binding configuration:
Apply the above configuration to your service and mex:
Create a client and use NetworkCredential to pass your credentials:
There are other ways to set username & password indivdually but it didn't work in .Net 4.0.
USERACCOUNT is a domain account or LDAP to which your WCF host computer is joined to.
If server isnt joined to a domain then create an account locally by running "lusrmgr.msc"
您需要注意两个主要事项:
可能是第二个问题给您带来了问题。 IIS 日志应包含正在进行调用的用户。
There are two main things that you need to watch out for:
It is probably the second that is giving you problems. The IIS log should contain which user is making the call.