473,498 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Threading & Security Context question

I'm running an ASP.NET application which uses
impersonation & Windows authentication to set the current
Principal. One of my methods was taking an awful long
time to run, so I decided to launch it in a new thread
using the following two lines of code:

Thread bob = new Thread(new ThreadStart(MyMethodName));
bob.Start();

When MyMethodName is executed, it attempts to make a
remote registry call & causes a SecurityException with
the message "Access Denied". Is "bob" running under the
same context as my original code? If not, how can I
force this new thread to share these permissions?

A shiny new donkey to whoever can help me solve this
problem!

JER
Nov 15 '05 #1
1 1596
Update:

I was able to solve this by capturing the current
Identity token and storing it in a place that both the
primary thread and the new thread could both access.
Then I called
System.Security.Principal.WindowsIdentity.Imperson ate and
passed it this shared token.

JER
-----Original Message-----
I'm running an ASP.NET application which uses
impersonation & Windows authentication to set the currentPrincipal. One of my methods was taking an awful long
time to run, so I decided to launch it in a new thread
using the following two lines of code:

Thread bob = new Thread(new ThreadStart(MyMethodName));
bob.Start();

When MyMethodName is executed, it attempts to make a
remote registry call & causes a SecurityException with
the message "Access Denied". Is "bob" running under the
same context as my original code? If not, how can I
force this new thread to share these permissions?

A shiny new donkey to whoever can help me solve this
problem!

JER
.

Nov 15 '05 #2

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

Similar topics

36
16313
by: Thomas | last post by:
after spending countless hours trying, i give up and hope to get some help in here. on server1 i got the web myweb.com with my test.asp. in the test.asp, i'm trying to read a file from an UNC...
12
8447
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too....
72
4122
by: Paminu | last post by:
In math this expression: (a < b) && (b < c) would be described as: a < b < c But why is it that in C these two expressions evaluate to something different for the same values of a, b and...
4
2906
by: hazz | last post by:
If I successfully run a VS.NET app which includes the following; ************************** APP 1 **************************** m_iIdnt = new...
5
358
by: Adrian Bezzina | last post by:
Hi Everyone, I am having difficulty in starting a new thread in ASP.NET while processing a page request. I have an aspx page that runs a whole lot of batch reports. These batch reports could...
7
318
by: Anthony Nystrom | last post by:
What is the correct way to stop a thread? abort? sleep? Will it start up again... Just curious... If the thread is enabling a form, if the form is disposed is the thread as well? Thanks, ...
10
2515
by: Bryce Calhoun | last post by:
Hello, First of all, this is a .NET 1.1 component I'm creating. SUMMARY ----------------------- This component that I'm creating is, for all intents and purposes, a document parser (I'm...
1
1867
by: Patrick | last post by:
I have an ASP.NET web service whose Web.Config is set to use impersonation <authentication mode="Windows" /> <identity impersonate="true" /> Within a Web Method, I want to use...
0
6710
by: Vijay | last post by:
Prep Courses for International Certifications, CSTE & CSQA & ISEB & ISTQB &Business Analyst & SOA Certifications in HYDERABAD. After receiving overwhelming response to our last 50+ batches, ...
0
7203
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6885
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...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4908
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4588
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
290
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.