Security for a worker thread

M

maa

I have my main asp.net thread which can access the database using
impersonation=
true. I then create worker threads but they don't have rights to the db and
login fails. Is there a way to delegate/transfer the creating thread rights
to the worker thread?
Thanks,
maa
 
M

maa

Dominick,

This will eventually go on a client site so the config switch is not
accessible. I am using C#/.Net 2.0 so I can possible change the create thread
to allow the rights to flow. Is that possible?
In other words I have access programmatically to set the rights/context for
the new thread.

Thanks,
maa
 
D

Dominick Baier

I am confused. Are you talking about ASP.NET or clients?

In general impersonation information flows to newly created threads by default
since .net 2.0.
ASP.NET is an exception here because it was considered as a breaking change
- thats why there is the config file to opt-in to the new behavior.

How do you create the thread?
 
D

Dominick Baier

ah and btw - the account need the SeImpersonatePrivilege to make impersonation
work.
 
M

maa

I am working in Asp.Net. When I create the threads, the threads can not
access the database. Sorry for the confusion.
Thanks,
maa
 
D

Dominick Baier

simply do a

string username = WindowsIdentity.GetCurrent().Name in your thread proc to
see if the impersonation token has been flowed.

or add a watch for $user to the debug watch window
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top