Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms-based security but want ASPNET

Status
Not open for further replies.

SpiderBear6

Programmer
Sep 17, 2003
422
AU
I'm using forms based security which is good however I want to be able to delete some files off the server from an asp.net page. My problem is that the person who logs onto my web site doesn't have permission to do this. So I gave permission for the ASPNET user to delete the files but now I need to try and impersonate ASPNET in the code so that I can delete the files.

Any ideas how to do that?

--------------------------------------
"We are star-stuff. We are the universe made manifest trying to figure itself out."
-- Delenn in Babylon 5 - "A Distant Star"
 
Hi Spider

Unless I'm completely wrong here the forms based authentication doesn't have any relationship to the windows security which applies read, execute, delete etc permissions to folders and files om your server. This is handled by the windows account that ASP.NET is running under on your machine. By default this is the MACHINENAME\ASPNET account though you can tell ASP.NET to impersonate another windows user in your web.config by adding the tag.

<identity impersonate=&quot;true&quot; userName=&quot;acountname&quot; password=&quot;password&quot; />

On our intranet all applications have there own domain user account which they run under which sets permissions for their file access and also in SQL.

Hope this helps

Rob

Go placidly amidst the noise and haste, and remember what peace there may be in silence - Erhmann 1927
 
That's what I thought, so it should have worked when I gave the ASPNET account full control over the directory that I was trying to delete, right? But it didn't. Actually thinking about it, my anonymous account is the IUSR account, so maybe that's the one I need to give full control. Will get back to you on that.

Thanks Rob, you seem to be always trying to come to my rescue.

--------------------------------------
&quot;We are star-stuff. We are the universe made manifest trying to figure itself out.&quot;
-- Delenn in Babylon 5 - &quot;A Distant Star&quot;
 
Nope that didn't work. I only have anonymous set in IIS with a user of IUSR associated with it.

--------------------------------------
&quot;We are star-stuff. We are the universe made manifest trying to figure itself out.&quot;
-- Delenn in Babylon 5 - &quot;A Distant Star&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top