如何使用IIS集成Windows身份验证,但使用另一个用户访问数据库? [英] How to use IIS Integrated Windows Authentication but access the DB using another user?

查看:264
本文介绍了如何使用IIS集成Windows身份验证,但使用另一个用户访问数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前在单个服务器上定义了两个WCF服务:

We currently have two WCF services defined on a single server:

  • 网关WCF服务,该服务已在具有Windows集成身份验证的IIS中部署.这是用户的切入点,它确认允许用户访问该服务.该服务仅调用下一个服务.
  • 在IIS中部署的具有匿名访问权限的业务WCF服务,配置为以具有数据库访问权限的Windows用户身份运行.使用集成身份验证来设置此服务的数据库访问权限.
  • Gateway WCF service deployed in IIS with Windows Integrated Authentication.  This is the entry point for users, and it confirms that the are allowed to access the service.  This service just calls the next service.
  • Business WCF service deployed in IIS with anonymous access, configured to run as a Windows user that has database access.  The DB access for this service is setup with integrated authentication.

使用此设置,用户可以访问网关服务,该服务称为与数据库交互的业务服务.我想将其折叠到一个WCF服务中,但是我不想在配置的数据库中输入数据库用户名和密码. 服务.还有其他选择吗?

With this setup, users hit the Gateway service, and it calls the Business service, which interacts with the database. I want to collapse this into one WCF service, but I don't want to have to put a database username and password in the configuration of the service.  Are there any other options?

预先感谢

推荐答案

是的,有一种方法可以做到这一点.这称为模拟和/或委派.
看一下这篇文章: http://developers.de/blogs/damir_dobric/archive/2007/10/14/user-impersonation-in-wcf.aspx .
简要介绍了如何执行此操作.
Yes there a way to do that. It is called impersonation and/or delegation.
Take a look on this post: http://developers.de/blogs/damir_dobric/archive/2007/10/14/user-impersonation-in-wcf.aspx.
It briefly describes how to do that.


这篇关于如何使用IIS集成Windows身份验证,但使用另一个用户访问数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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