473,326 Members | 2,173 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,326 software developers and data experts.

Impersonate a user

I am trying to impersonate the windows account in code like in
http://support.microsoft.com/default...b;en-us;306158 and then all
aspx pages to run on this new account (ACL on files is only for this
account).
But after the first page when I impersonate it and I redirect to another
page the account reverse to original.
How can I do to maintain impersonation but in code not in web.config.
Nov 16 '05 #1
1 3210
you need to understand that http protocol is stateless. while ASP.NET tries
to simulate statefulness, that's just all fake. when you redirect, the
current request is terminated, and the client is instructed by the server to
send another request for the new page, all the previous state, including your
impersonation is lost because the request is handled by a completely new
thread. you will need to impersonate again on the new thread.

"Sorin Sandu" wrote:
I am trying to impersonate the windows account in code like in
http://support.microsoft.com/default...b;en-us;306158 and then all
aspx pages to run on this new account (ACL on files is only for this
account).
But after the first page when I impersonate it and I redirect to another
page the account reverse to original.
How can I do to maintain impersonation but in code not in web.config.

Nov 16 '05 #2

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

Similar topics

1
by: moemeelaung | last post by:
Hi ASP/Windows experts out there I really need help with this Impersonate function. I have machine A and B. A hosts my ASP page which is to create a user account on the machine B. The...
14
by: Ian Frawley | last post by:
Anyone used the WindowsIdentity class with success? I find if I try to change the current identity to one that exists on another machine and then try to perform and action on that machine i.e....
8
by: BLiTZWiNG | last post by:
After playing with the code shown and utilising Willy Denyottes' help, I have come to the conclusion that there is some form of difference between the managed WindowsIdentity.Impersonate() over the...
4
by: Alvaro Pereira | last post by:
I have a ASP.NET project that prints a report to a NETWORK- PRINTER. I have impersonate=true in my web.config, but all reports are printed under ASPNET user (the one that is setted in...
6
by: Mark | last post by:
We are attempting to use impersonation to connect from our ASP.NET website to a SQL Server on the same domain. The code below works just fine in our web.config file: <identity impersonate="true"...
6
by: Erez Shor | last post by:
Hi, I need to build and asp page which access a remote windows server's registry and create a registry key. In order for the ASP page to be able to access the registry on the remote server I need...
1
by: Svein Terje Gaup | last post by:
I have a website running on Windows 2000 Server, that should be able to retrieve data from a datawarehouse on another machine running Windows 2000 Server, SQL Server 2000 and SQL Server 2000...
8
by: RTT | last post by:
i'm writing a windows form but codebased a iwant to run the code as a different user. like in a webapplication you can impersonate a user so the website does not run on the standard ASP.NET...
2
by: rockdale | last post by:
Hi, all: My asp.net application calles MS speech 5.1 and generate a wav file on server's path. Everything runs perfectly on my development machine. But when I move the appl to production server,...
4
by: =?Utf-8?B?QXZhRGV2?= | last post by:
ASP.Net 2. We are migrating to Windows 2008 64 bit Server with IIS 7 from Windows 2003 32 Bit with IIS 6. A few library classes we wrote uses impersonation in code like explained in this...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.