473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How do I get impersonation to work?

Here is my scenario. I have an ASP.net page that exports a Crystal Report file. When I export the file, the app uses the ASPNET user, which doesn't have the appropriate rights to the network drive that I'm saving the report to.

I thought by adding the <identity impersonate="true" userName="user" password="password"/> to my web.config file would do the trick (obviously giving it a valid user and password). But when I run filemon to look at the access denied error, it shows the user as ASPNET.

I have also tried the following (to no avail):

currentWindowsIdentity = CTypeUser.Identity,System.Security.Principal.Windo wsIdentity)
impersonationcontext = currentWindowsIdentity.Impersonate()

<code to be run under the impersonation....>

impersonationcontext.Undo()

Am I leaving something out, not doing it right at all ???? I have not tried the LogonUser scenario, as I thought I had this working with just the web.config yesterday, but today, no go...

Any help would be greatly appreciated.

Ed
Nov 20 '05 #1
2 963
UnCheck Anonymous access in IIS

"ECrawford" wrote:
Here is my scenario. I have an ASP.net page that exports a Crystal Report file. When I export the file, the app uses the ASPNET user, which doesn't have the appropriate rights to the network drive that I'm saving the report to.

I thought by adding the <identity impersonate="true" userName="user" password="password"/> to my web.config file would do the trick (obviously giving it a valid user and password). But when I run filemon to look at the access denied error, it shows the user as ASPNET.

I have also tried the following (to no avail):

currentWindowsIdentity = CTypeUser.Identity,System.Security.Principal.Windo wsIdentity)
impersonationcontext = currentWindowsIdentity.Impersonate()

<code to be run under the impersonation....>

impersonationcontext.Undo()

Am I leaving something out, not doing it right at all ???? I have not tried the LogonUser scenario, as I thought I had this working with just the web.config yesterday, but today, no go...

Any help would be greatly appreciated.

Ed

Nov 20 '05 #2
Another thing you muse set "Windows" authentication in web.config
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ripa Horatiu | last post by:
Does anyone knows how can I impersonate to another user (basically Administrator) for a piece of my code? I've tried the samples provided by MS but they didn't worked. -- Horatiu Ripa
12
by: Anil Krishnamurthy | last post by:
We have an ASP.NET application that uses COM objects through Interop. The web application requires access to network and database resources and hence, needs to impersonate a domain account. The...
0
by: Elliot M. Rodriguez | last post by:
I have a web app that uses Crystal Reports 8.5 along with VB.Net. When attempting to access reports by a UNC file share path, I was getting access denied errors. I solved this problem eventually...
3
by: Wm. Scott Miller | last post by:
What is the difference between using a username and password in the processmodel section vs using one in impersonation in the machine.config file? What are the advantages of each and what are the...
7
by: Bonj | last post by:
Hi I made a naff web application which uses the impersonation method in MSDN (can't find it now, but it basically revolves around creating a token by calling the LogonUser API, calling...
1
by: zhuang | last post by:
Dear all, I found a very interesting thing about viewing crystal report (located on network drive) with asp.net application. To do the impersonation, modify web.config does not work, you have...
3
by: headware | last post by:
We have a web app that is running under Integrated Windows Authentication. It must consume to a web service we are publishing on another server, also running under Integrated Windows...
8
by: Marco Mechelli | last post by:
Hello, i'm facing with the following problem while using the Job API during an impersonation. I have a main process that needs to do the following: 1. Creates a new Job Object that will be...
0
by: Daniel Knöpfel | last post by:
Hello On our asp.net 2.0 website we impersonate every request to the identity of the user logged in. This works this way: 1. user logs in, providing username, password 2. user is authenticated...
4
by: Saqib Ali | last post by:
I have some security concerns over storing a Active Directory username/ passwd in a text based web.config file for the identity impersonation definition. I know that web.conf is not accessible...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.