impersonation

Access a shared folder(which is protected)

非 Y 不嫁゛ 提交于 2019-12-12 15:25:29
问题 I need help in writing a C# script which can access a secured shared location(i hv the username and password) in order to access some files from that location and also dump some files over there pragmatically. Thank you in advance 回答1: To access a network share that is protected you need to call LogonUser and do impersonation within your application. The MSDN article provides a code sample. Then you can just browse, copy/move, etc with the System.IO namespace. For instance: System.IO

Verify that the currently authenticated windows user has delegation rights

可紊 提交于 2019-12-12 12:42:00
问题 Given that I have a WCF service using windows authentication, and I want to impersonate them and call another WCF service, like so: using (ServiceSecurityContext.Current.WindowsIdentity.Impersonate()) { // call another WCF service } I've set all the config settings and it works fine, as long as on the client side,they include the following line: client.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Delegation; But, how do I verify before trying to make the call

Get impersonated user name

痴心易碎 提交于 2019-12-12 08:04:54
问题 I have a class that needs to know name of a user currently in effect. Environment.UserName or WindowsIdentity.GetCurrent().Name is for that. But when impersonation is enabled, they return LocalUser name not the ImpersonatedUser name. How to get name of currently impersonated user? The app is C# console application, I know that impersonation is in effect since I get priviledges of ImpersonatedUser . Sure I can make impersonation code save impersonated username to some global variable, but it

Accessing mapped drives when impersonating in ASP.NET

依然范特西╮ 提交于 2019-12-12 07:38:42
问题 Short version : Is it possible or not to use impersonation in ASP.NET to access mapped drives? Long Version: I'm currently using impersonation in ASP.NET to gain access to network files. This is working perfectly for any network file using a UNC path, but it is failing to access any files on mapped drives defined for the user account I'm impersonating. For example, let's say a file lives on the network at \\machine\folder\file.txt , and let's also say that drive S: is mapped to \\machine

Impersonation with IIS7, WCF Rest, custom authentication module

喜欢而已 提交于 2019-12-12 04:44:08
问题 So I am working on setting up a WCF service, hosted in iis7. The service is a REST service. Up till now our requirements for authentication were that only domain accounts were going to connect to the service. We are using basic authentication and using impersonation for making calls through our business layer to our DB. This is all working well. Now we have the need to allow non-domain accounts to use our service. Due to somethings with IIS I implemented this (http://custombasicauth.codeplex

Does this require windows delegation to be enabled for server service account?

好久不见. 提交于 2019-12-12 02:29:56
问题 I have a client console application which has got some user credentials - domain\user and plain-text password. The client app obtains windowsidentity object for that user by invoking LogonUser (dwLogonType:LOGON32_LOGON_NETWORK) win32 API. I use windowsidentity to impersonate and make WCF Service call (hosted on different machine). The WCF Service is configured to use TCP protocol with windows integrated security. The call fails with SecurityNegotiation exception with error: The remote server

symfony impersonate across different hosts

余生长醉 提交于 2019-12-12 01:44:45
问题 I'm trying to impersonate different users in Symfony, but different that other examples like Symfony impersonation - separate firewalls and separate user providers, in my case is not only the provider that's different, but the host. firewalls: admin: pattern: ^/ host: "%host_admin%" provider: admin [...] switch_user: role: ROLE_ADMIN provider: client #host: "%host_public%" <-- tried this.. does not work context: cmb_context client: pattern: ^/ host: "%host_public%" provider: client [...]

how to impersonate a windows domain user for automated web testing?

时光总嘲笑我的痴心妄想 提交于 2019-12-11 19:49:50
问题 we are about to build several UI test with selenium-rc and the java client the app itself is a classic asp web application that uses integrated security to retrieve the user's permissions from a database, and then, according to those permissions, displays a menu with the appropiate options. we'd like to automate that test, something like if the logged user is domain/user_test then optionx shoulb be enabled ... is there some way to programatically impersonate a domain account, so that

Impersonate a user on another domain, one way trust

ε祈祈猫儿з 提交于 2019-12-11 16:53:40
问题 I am attempting to impersonate a user on another domain, for the purpose of querying that domain. See Accessing user info from a one way trust for some background. My impersonation works correctly when I'm using a local domain user. When I specify the target domain, which is also over LDAPS port 636, it doesn't work. My impersonation returns null. My Impersonation Code public static WindowsImpersonationContext ImpersonateUser(ConnectionCredentials user) { WindowsIdentity tempWindowsIdentity;

Calling web service with current users credentials from SharePoint

点点圈 提交于 2019-12-11 16:52:55
问题 When I run this C# code from my vs2010 client it works authenticating as me. However if I deploy the code to a sharePoint page on a webserver I get an authentication error from the web service. I understand this some double hop issue and I need to impersonate. maybe the code is calling the web service as the SharePoint service user. Any easy way around this beyond hard coding credentials? Uri uri = new Uri("http://tempuri.org/"); ICredentials credentials = CredentialCache.DefaultCredentials;