问题
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