简体   繁体   English

如何通过服务帐户和集成安全性运行WPF(C#)应用程序

[英]How to run wpf(c#) application by service account and integrated security

i want to run my WPF aplication with service account... 我想使用服务帐户运行WPF应用程序...

Maybe i dont understain situation currectlly but i want to use integrated security=true; 也许我现在并不能保持现状,但是我想使用integrated security=true; in my connectionString and run application localy but with different account. 在我的connectionString中,并使用不同的帐户运行应用程序本地。 Is that even possible? 那有可能吗?

Lets say my windows login acc is testAcc and my service account is SAtestAcc . 可以说我的Windows登录acc是testAcc ,我的服务帐户是SAtestAcc SAtestAcc has execute rights on database1 and testAcc doesnt have any on same database1... SAtestAcc对database1具有执行权限,而testAcc在同一database1上没有任何权限...

So how do i specify in my connectionString that i am trying to connect to database with AStestAcc, but not by specifying username nad password in connectionString but by using integratedSecurity=true . 因此,如何在我的connectionString中指定我要尝试使用AStestAcc连接到数据库的方法,而不是通过在connectionString中指定username nad password不是通过使用integratedSecurity=true

Again: Is that even possible? 再说一次:那有可能吗?

Thanx 感谢名单

Integrated security means that it takes the current security context and uses this. 集成安全性意味着它将采用当前的安全性上下文并使用它。 So to appear as another user you would have to authenticate with username and password and use impersonation. 因此,要成为其他用户,您将必须使用用户名和密码进行身份验证并使用模拟。 Here is a good article on that I have referred to a few times. 这是我提到过的好文章。

http://msdn.microsoft.com/en-us/library/w070t6ka(v=vs.110).aspx http://msdn.microsoft.com/zh-CN/library/w070t6ka(v=vs.110).aspx

You will need to run the application under the user context of SAtestAcc. 您将需要在SAtestAcc的用户上下文下运行该应用程序。

See the below on instructions for how to do this in Windows 7. 有关如何在Windows 7中执行此操作的说明,请参见以下内容。

http://www.sevenforums.com/tutorials/419-run-different-user.html http://www.sevenforums.com/tutorials/419-run-different-user.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM