impersonation

IIS7 Impersonation doesn't work to access TFS repository

南笙酒味 提交于 2019-11-28 11:20:45
I'm trying to build an ASP.NET page that adds a work item in TFS. I have enabled impersonation and Windows authentication: <authentication mode="Windows" /> <identity impersonate="true" password="" userName="" /> <customErrors mode="Off" /> In the page, I access TFS and try to add a work item: TfsTeamProjectCollection prjCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("xxx")); WorkItemStore store = prjCollection.GetService<WorkItemStore>(); ... However, it only works when I select SpecificUser in ASP.NET Impersonation and store the credentials. It doesn't work

Impersonation using ASP.NET Membership Provider

て烟熏妆下的殇ゞ 提交于 2019-11-28 11:00:34
问题 I have a custom membership/roles provider, due to the nature of the project it will require admins to login as users while assisting them with queries. Now, Its easy to re-log the admin in with the selected membership account, however this means that the admin will effectively be logged out. I'm looking for a way to allow admins to impersonate users yet very easily switch back to there own account at any time. Any suggestions? 回答1: This should be the sort of thing you want. You can call the

Impersonate admin account to edit registry key not working (C#)

a 夏天 提交于 2019-11-28 10:37:25
问题 I am using the following code to edit a registry key in the local machine hive ('SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\%SID%'). Everything seems to be fine until I actually try to open the registry key (with write permissions); a SecurityException is thrown with the message 'Requested registry access is not allowed.' I've checked and rechecked the permissions for the registry key and the user I'm impersonating and it all checks out. The code runs fine when logged into the

System.Diagnostics.Process impersonating other user

自作多情 提交于 2019-11-28 10:04:40
问题 I have the following code which is working. My callback method is called with the program's output as it is generated. var proc = new System.Diagnostics.Process(); //proc.StartInfo.Domain = DOMAIN; //proc.StartInfo.UserName = USERNAME; //proc.StartInfo.Password = BuildPasswordString(); proc.StartInfo.UseShellExecute = false; proc.StartInfo.FileName = EXEC_PATH; proc.StartInfo.Arguments = EXEC_ARGS; proc.StartInfo.RedirectStandardOutput = true; proc.Start(); proc.OutputDataReceived += proc

Impersonation and Delegation in ASP.NET

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 08:21:02
问题 I'm having problems accessing a text file on a remote server with ASP.NET. The ASP.NET 1.1 application is running on Server 2003 using Impersonation with the requester's Windows Credentials. The client, webserver, and remote server are all on the same domain, and the user has permission to access the text file. The user can open the text file from their machine over a UNC share. When the user runs the site logged in directly on the server it works fine. However, when the user tries on their

Starting remote Windows services with ServiceController and impersonation

时光总嘲笑我的痴心妄想 提交于 2019-11-28 08:03:04
问题 I have a .NET MVC3 application that needs to be able to turn a remote service on and off. In order to do this I am impersonating a specific user account via WindowsIdentity.Impersonate(). To test the user's permissions I can log in as the user and execute sc.exe \\[server] start [service] from the command prompt. I also know that the impersonate command is working as expected because the application runs anonymously and therefore cannot control services on my local machine ( . ) without

How to Impersonate a user in managed code?

微笑、不失礼 提交于 2019-11-28 07:49:53
Given a username and password how do i impersonate that user and run some code as that user. And by managed i mean without pinvokes or dllimports This is the wrapper class we created that has worked on several different Windows platforms: public class Impersonator { // constants from winbase.h public const int LOGON32_LOGON_INTERACTIVE = 2; public const int LOGON32_LOGON_NETWORK = 3; public const int LOGON32_LOGON_BATCH = 4; public const int LOGON32_LOGON_SERVICE = 5; public const int LOGON32_LOGON_UNLOCK = 7; public const int LOGON32_LOGON_NETWORK_CLEARTEXT = 8; public const int LOGON32_LOGON

In Boost ASIO how can I set the source IP address to impersonate another server's IP address?

可紊 提交于 2019-11-28 07:03:58
问题 I have a Boost ASIO-based C++ server program and I'd like to be able to set the source IP address used by TCP to that of another server. I know one can read the source and destination IP addresses but presumably they can be set as well? Presumably if I set the "wrong" source IP address in the C++ code there will be some interaction with the network stack. Won't the network stack re-set the source IP address on the way out even if the C++ code is right? Is the right way to do this to write C++

google oauth2 impersonate service account with user@gmail.com

感情迁移 提交于 2019-11-28 06:09:16
问题 I wanted to access some google api services: GDrive API Contact API People API And I'm struggeling with the oauth2 impersonate service account flow (you know that one: Google Oauth v2 - service account description. For impersonification you need to apply the "Delegating domain-wide authority" in the google apps console, download the correspoding pk12 file and activate the api in a google console project. At the moment I always get: com.google.api.client.auth.oauth2.TokenResponseException: 401

App pool identity versus impersonation identity?

为君一笑 提交于 2019-11-28 02:40:32
问题 I found only one thread relating to this but it did not answer the question. I'm curious to a link or explanation of the difference between setting an impersonation user via in the web.config versus setting the application pool identity in IIS. They seem to be independent and am confused on the detailed differences. Thanks. 回答1: Using impersonation in the web.config allows you to override whatever identity was configured for the Application Pool the app is running under - it's just a more