473,395 Members | 1,763 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,395 software developers and data experts.

Impersonating currently logged in user

Hello,
I am running a ASP.Net application. It runs by defaul in the context
of ASPNET user. I want to dynamically impersonate it so as to run in the
context of currently logged in user. I know it is possible by specifying
username, domain and password and using WindowsIdentity,
WindowsImpersonationContext classes. But I wanted to know whether it is
possible to achieve this by not passing username and password and system
taking the same from currently logged in user.

Thanks,
Sushi

Nov 17 '05 #1
1 2801
What you have to do:

Disable anonymous access in IIS for your web-application.
in your web.config add the following line:
<identity impersonate="true" />

And you're done.
"sushi" wrote:
Hello,
I am running a ASP.Net application. It runs by defaul in the context
of ASPNET user. I want to dynamically impersonate it so as to run in the
context of currently logged in user. I know it is possible by specifying
username, domain and password and using WindowsIdentity,
WindowsImpersonationContext classes. But I wanted to know whether it is
possible to achieve this by not passing username and password and system
taking the same from currently logged in user.

Thanks,
Sushi

Nov 17 '05 #2

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

Similar topics

1
by: Marcin Zmyslowski | last post by:
Hello all! I want to create a page in ASP language which gives me information about currently logged users. I thought to do it by this way: when somebody will log in to page, there will be a...
7
by: Jason | last post by:
I have an ASP.NET application with forms authentication. However, the login details correspond to a Windows account (I cannot use Windows authentication). If I obtain a token with LogonUser, can I...
2
by: SStory | last post by:
I have a service which has no U/I, that I use to ensure a certain tray application is running. I would like for the service which runs under "Local System", to create the process as a normal app...
7
by: John | last post by:
Hi We can get the current logged in user's name but is it also possible to get the default email form outlook of the currently logged-in user as well? The reason for this is that I need to email...
1
by: accyboy1981 | last post by:
Hi, I'm currently in charge of a website on an internal domain. I'm currently modifying some of the web pages and am wanting one of the pages to be dynamic and read two files located on seperate...
6
by: MuZZy | last post by:
Hi, I am looking to find a way to get currently logged in user's object GUID without querying ActiveDirectory. For example, when i log in to my laptop from home, I'm not on the office network so...
8
by: simonlpwaters | last post by:
I need to obtain the username of the currently logged in user on a machine. However, the program that needs to do this will be running under different credentials to the logged in user, so using...
2
by: gihope | last post by:
Hi, can anyone advise me how I can access the UserName of a currently logged in user without using the LoginName control. For instance I want to search tables I have created in my database that I...
1
by: =?Utf-8?B?c3VidGlsZQ==?= | last post by:
Hi :-) I'm having some trouble with LDAP and Active Directory on Win2k3 I use Windows Authentication and the code System.Threading.Thread.CurrentPrincipal.Identity.Name gives me the correct...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.