CurrentPrincipal and new Thread

M

marcell

I have an ASP webapp that needs to access files using a UNC pathname to a
network-share

I setup "impersonation" and that all works as expected when executed in the
CurrentThread.

I need to kick-off a Method which will need exactly the same permissions
inside a new,long running, low priority Thread.

Problem is even if I set the new Thread's.CurrentPrincipal =
oldThread's.CurrentPrincipal ,
it displays the correct Identity.Name in the new Thread, but doesnt actually
adopt that old principal.

It moans about logon failure, and won't acually give me access to the Remote
Share.

One defffinite Solution is to Change the <processModel userName="..."
password=".."> tag in machine.config,
but this causes other problems as I have other WebApps that don't like
running under another account.
(and I don't think it's the right way to do it?)



Is there maybe a way to use one of the ThreadPools Threads for this job?
or is there a better way to do this?


Any Ideas?
 
Y

Yan-Hong Huang[MSFT]

Hello,

How is everything going? If you have any more questions on this issue,
please feel free to post here and we will follow up.

Thanks very much.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ¨C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
-http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
p&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top