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

守給你的承諾、 提交于 2019-12-25 10:53:47

问题


i want to run my WPF aplication with service account...

Maybe i dont understain situation currectlly but i want to use integrated security=true; in my connectionString and run application localy but with different account. Is that even possible?

Lets say my windows login acc is testAcc and my service account is SAtestAcc. SAtestAcc has execute rights on database1 and testAcc doesnt have any on same 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.

Again: Is that even possible?

Thanx


回答1:


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




回答2:


You will need to run the application under the user context of SAtestAcc.

See the below on instructions for how to do this in Windows 7.

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



来源:https://stackoverflow.com/questions/20219587/how-to-run-wpfc-application-by-service-account-and-integrated-security

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!