Ask a Question related to ASP.NET Security, Design and Development.
-
jzink #1
asp.net, basic authentication, file access
I have a asp.net application that is configured to
use "basic authentication". The application needs to have
access to delete a file in let's say directory
d:\inetpub\wwwroot\myApp\reports. Do I need to grant
access to the ASPNET account or to the accounts of the
users who will be accessing the site ?
I put the following line of code in
Thread.CurrentPrincipal.Identity.Name.ToString() and it
returns the id of the person logged in.
thanks for your help
jzink Guest
-
sso/basic authentication
We are interested in using basic authentication (with https) to implement Single Sign On (SSO) with Internet Explorer clients. Does anyone have... -
Custom Basic Authentication
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello all, I want to be able to use Basic Authentication without the need of specific accounts in... -
ASP.Net Forms authentication with basic authentication popup
Relatively new to ASP.Net but have a strange problem. My site uses forms authentication for a large administration section however after the user... -
Basic Access Authentication
I found this article http://www.dotnet247.com/247reference/msgs/22/113795.aspx, but unfortunatly it no longer exists here, so I'm re-opening it. ... -
Basic authentication with LWP::Parallel
Hi, I am having problems doing basic authentication with LWP::Parallel::UserAgent. It works fine when I use LWP::Useragent with the following... -
Andrea D'Onofrio [MSFT] #2
Re: asp.net, basic authentication, file access
If you have turned the impersonation on the .net code will run under the
identity of he users who will be accessing the site, else the .net code will
run under the ASPNET account (this is a default) identity.
HtH,
Andrea
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"jzink" <zinks.home@verizon.net> wrote in message
news:065401c3d141$c293ee60$a501280a@phx.gbl...> I have a asp.net application that is configured to
> use "basic authentication". The application needs to have
> access to delete a file in let's say directory
> d:\inetpub\wwwroot\myApp\reports. Do I need to grant
> access to the ASPNET account or to the accounts of the
> users who will be accessing the site ?
>
> I put the following line of code in
> Thread.CurrentPrincipal.Identity.Name.ToString() and it
> returns the id of the person logged in.
>
>
>
> thanks for your help
Andrea D'Onofrio [MSFT] Guest
-
JZink #3
Re: asp.net, basic authentication, file access
I don't believe I have impersonation turned on. Here is
my machine.config entries:
<identity impersonate="false" userName="" password=""/>
<processModel
enable="true"
timeout="Infinite"
idleTimeout="Infinite"
shutdownTimeout="0:00:05"
requestLimit="Infinite"
requestQueueLimit="5000"
restartQueueLimit="10"
memoryLimit="60"
webGarden="false"
cpuMask="0xffffffff"
userName="machine"
password="AutoGenerate"
logLevel="Errors"
clientConnectedCheck="0:00:05"
comAuthenticationLevel="Connect"
comImpersonationLevel="Impersonate"
responseDeadlockInterval="00:03:00"
maxWorkerThreads="20"
maxIoThreads="20"
/>
However, if I place this code in an aspx page:
Thread.CurrentPrincipal.Identity.Name.ToString()
I see the id of the person being authenticated.
will run under the>-----Original Message-----
>If you have turned the impersonation on the .net codethe .net code will>identity of he users who will be accessing the site, elseconfers no rights.>run under the ASPNET account (this is a default) identity.
>
>HtH,
>Andrea
>
>--
>This posting is provided "AS IS" with no warranties, andhave>
>
>"jzink" <zinks.home@verizon.net> wrote in message
>news:065401c3d141$c293ee60$a501280a@phx.gbl...>> I have a asp.net application that is configured to
>> use "basic authentication". The application needs to>>> access to delete a file in let's say directory
>> d:\inetpub\wwwroot\myApp\reports. Do I need to grant
>> access to the ASPNET account or to the accounts of the
>> users who will be accessing the site ?
>>
>> I put the following line of code in
>> Thread.CurrentPrincipal.Identity.Name.ToString() and it
>> returns the id of the person logged in.
>>
>>
>>
>> thanks for your help
>
>.
>JZink Guest
-
Holly Mazerolle #4
RE: asp.net, basic authentication, file access
You will want to grant access to the ASPNET account for deleting the file.
If you want only the authenticated user to have the ability to delete the
file then you could simply set impersonation to true and set permissions
for that logged on user. If you do this and you are still having problems,
a good way to troubleshoot would be to use filemon while you repro any
errors. You can download it from [url]www.sysinternals.com[/url]. It will show you
what user is accessing what files and whether the access was successful or
not.
This posting is provided "AS IS" with no warranties, and confers no rights.
Holly
Holly Mazerolle Guest
-
jzink #5
RE: asp.net, basic authentication, file access
I do not have impersonation set to true, yet when I put
this code into my aspx page:
Response.Write (
Thread.CurrentPrincipal.Identity.Name.ToString() )
it will write out the name of the user who was
authenticated not ASPNET. What am I missing ???
deleting the file.>-----Original Message-----
>You will want to grant access to the ASPNET account forability to delete the>If you want only the authenticated user to have theset permissions>file then you could simply set impersonation to true andhaving problems,>for that logged on user. If you do this and you are stillyou repro any>a good way to troubleshoot would be to use filemon whilewill show you>errors. You can download it from [url]www.sysinternals.com[/url]. Itwas successful or>what user is accessing what files and whether the accessconfers no rights.>not.
>
>This posting is provided "AS IS" with no warranties, and>
>Holly
>
>.
>jzink Guest
-
Hernan de Lahitte #6
Re: asp.net, basic authentication, file access
If you want to see the identity of the worker process, that is, the account
that will be used to access your protected resource, you should use
System.Security.Principal.WindowsIdentity.GetCurre nt().Name.
This will return, in you case, the ASPNET account if you turn off
impersonation, or your logged on user account if you turn on impersonation.
--
Eng. Hernan de Lahitte - MSDE
Lagash Systems S.A. - Buenos Aires, Argentina
[url]http://www.lagash.com[/url]
"jzink" <zinks.home@verizon.net> wrote in message
news:096201c3d468$ab769af0$a601280a@phx.gbl...> I do not have impersonation set to true, yet when I put
> this code into my aspx page:
> Response.Write (
> Thread.CurrentPrincipal.Identity.Name.ToString() )
> it will write out the name of the user who was
> authenticated not ASPNET. What am I missing ???
>> deleting the file.> >-----Original Message-----
> >You will want to grant access to the ASPNET account for> ability to delete the> >If you want only the authenticated user to have the> set permissions> >file then you could simply set impersonation to true and> having problems,> >for that logged on user. If you do this and you are still> you repro any> >a good way to troubleshoot would be to use filemon while> will show you> >errors. You can download it from [url]www.sysinternals.com[/url]. It> was successful or> >what user is accessing what files and whether the access> confers no rights.> >not.
> >
> >This posting is provided "AS IS" with no warranties, and> >
> >Holly
> >
> >.
> >
Hernan de Lahitte Guest
-
jzink #7
Re: asp.net, basic authentication, file access
I changed the aspx code to print out
System.Security.Principal.WindowsIdentity.GetCurre nt().Name
and now i see NT AUTHORITY\NETWORK SERVICE. shouldn't i
see aspnet ???
that is, the account>-----Original Message-----
>If you want to see the identity of the worker process,should use>that will be used to access your protected resource, you().Name.>System.Security.Principal.WindowsIdentity.GetCurr entturn off>
>This will return, in you case, the ASPNET account if youon impersonation.>impersonation, or your logged on user account if you turnand>
>
>
>--
>Eng. Hernan de Lahitte - MSDE
>Lagash Systems S.A. - Buenos Aires, Argentina
>[url]http://www.lagash.com[/url]
>
>
>
>"jzink" <zinks.home@verizon.net> wrote in message
>news:096201c3d468$ab769af0$a601280a@phx.gbl...>> I do not have impersonation set to true, yet when I put
>> this code into my aspx page:
>> Response.Write (
>> Thread.CurrentPrincipal.Identity.Name.ToString() )
>> it will write out the name of the user who was
>> authenticated not ASPNET. What am I missing ???
>>>> deleting the file.>> >-----Original Message-----
>> >You will want to grant access to the ASPNET account for>> ability to delete the>> >If you want only the authenticated user to have the>> >file then you could simply set impersonation to truestill>> set permissions>> >for that logged on user. If you do this and you arewhile>> having problems,>> >a good way to troubleshoot would be to use filemonIt>> you repro any>> >errors. You can download it from [url]www.sysinternals.com[/url].access>> will show you>> >what user is accessing what files and whether theand>> was successful or>> >not.
>> >
>> >This posting is provided "AS IS" with no warranties,>>> confers no rights.>> >
>> >Holly
>> >
>> >.
>> >
>
>.
>jzink Guest
-
Hernan de Lahitte #8
Re: asp.net, basic authentication, file access
This is the default AppPoll Account for W2K3. This might be you case. The
ASPNET account is the default for an XP box or lower.
--
Eng. Hernan de Lahitte - MSDE
Lagash Systems S.A. - Buenos Aires, Argentina
[url]http://www.lagash.com[/url]
"jzink" <zinks.home@verizon.net> wrote in message
news:00ac01c3d48a$fe49a340$a601280a@phx.gbl...> I changed the aspx code to print out
> System.Security.Principal.WindowsIdentity.GetCurre nt().Name
> and now i see NT AUTHORITY\NETWORK SERVICE. shouldn't i
> see aspnet ???
>> that is, the account> >-----Original Message-----
> >If you want to see the identity of the worker process,> should use> >that will be used to access your protected resource, you> ().Name.> >System.Security.Principal.WindowsIdentity.GetCurr ent> turn off> >
> >This will return, in you case, the ASPNET account if you> on impersonation.> >impersonation, or your logged on user account if you turn> and> >
> >
> >
> >--
> >Eng. Hernan de Lahitte - MSDE
> >Lagash Systems S.A. - Buenos Aires, Argentina
> >[url]http://www.lagash.com[/url]
> >
> >
> >
> >"jzink" <zinks.home@verizon.net> wrote in message
> >news:096201c3d468$ab769af0$a601280a@phx.gbl...> >> I do not have impersonation set to true, yet when I put
> >> this code into my aspx page:
> >> Response.Write (
> >> Thread.CurrentPrincipal.Identity.Name.ToString() )
> >> it will write out the name of the user who was
> >> authenticated not ASPNET. What am I missing ???
> >>
> >> >-----Original Message-----
> >> >You will want to grant access to the ASPNET account for
> >> deleting the file.
> >> >If you want only the authenticated user to have the
> >> ability to delete the
> >> >file then you could simply set impersonation to true> still> >> set permissions
> >> >for that logged on user. If you do this and you are> while> >> having problems,
> >> >a good way to troubleshoot would be to use filemon> It> >> you repro any
> >> >errors. You can download it from [url]www.sysinternals.com[/url].> access> >> will show you
> >> >what user is accessing what files and whether the> and> >> was successful or
> >> >not.
> >> >
> >> >This posting is provided "AS IS" with no warranties,> >> >> confers no rights.
> >> >
> >> >Holly
> >> >
> >> >.
> >> >
> >
> >.
> >
Hernan de Lahitte Guest
-
jzink #9
Re: asp.net, basic authentication, file access
what do you mean by appPoll account and how come I don't
see nt authority\network service as a user in computer
management\users ??
be you case. The>-----Original Message-----
>This is the default AppPoll Account for W2K3. This might().Name>ASPNET account is the default for an XP box or lower.
>
>--
>Eng. Hernan de Lahitte - MSDE
>Lagash Systems S.A. - Buenos Aires, Argentina
>[url]http://www.lagash.com[/url]
>
>
>
>"jzink" <zinks.home@verizon.net> wrote in message
>news:00ac01c3d48a$fe49a340$a601280a@phx.gbl...>> I changed the aspx code to print out
>> System.Security.Principal.WindowsIdentity.GetCurre ntyou>> and now i see NT AUTHORITY\NETWORK SERVICE. shouldn't i
>> see aspnet ???
>>>> that is, the account>> >-----Original Message-----
>> >If you want to see the identity of the worker process,>> >that will be used to access your protected resource,you>> should use>> ().Name.>> >System.Security.Principal.WindowsIdentity.GetCurr ent>> >
>> >This will return, in you case, the ASPNET account ifturn>> turn off>> >impersonation, or your logged on user account if youput>> on impersonation.>> >
>> >
>> >
>> >--
>> >Eng. Hernan de Lahitte - MSDE
>> >Lagash Systems S.A. - Buenos Aires, Argentina
>> >[url]http://www.lagash.com[/url]
>> >
>> >
>> >
>> >"jzink" <zinks.home@verizon.net> wrote in message
>> >news:096201c3d468$ab769af0$a601280a@phx.gbl...
>> >> I do not have impersonation set to true, yet when Ifor>> >> this code into my aspx page:
>> >> Response.Write (
>> >> Thread.CurrentPrincipal.Identity.Name.ToString() )
>> >> it will write out the name of the user who was
>> >> authenticated not ASPNET. What am I missing ???
>> >>
>> >> >-----Original Message-----
>> >> >You will want to grant access to the ASPNET account[url]www.sysinternals.com[/url].>> and>> >> deleting the file.
>> >> >If you want only the authenticated user to have the
>> >> ability to delete the
>> >> >file then you could simply set impersonation to true>> still>> >> set permissions
>> >> >for that logged on user. If you do this and you are>> while>> >> having problems,
>> >> >a good way to troubleshoot would be to use filemon>> >> you repro any
>> >> >errors. You can download it from>>> It>> access>> >> will show you
>> >> >what user is accessing what files and whether the>> and>> >> was successful or
>> >> >not.
>> >> >
>> >> >This posting is provided "AS IS" with no warranties,>> >> confers no rights.
>> >> >
>> >> >Holly
>> >> >
>> >> >.
>> >> >
>> >
>> >
>> >.
>> >
>
>.
>jzink Guest
-
Hernan de Lahitte #10
Re: asp.net, basic authentication, file access
With AppPool, I refer to the Application Pool that has Windows 2003. To
check this, go to the IIS Management Console snap-in and in the Application
Pools folder, right click the DefaultAppPool node (This is the default
Application Pool for all Web Sites). In the Properties/Identity tab option,
you will see you selected Application Pool Identity.This should be the
Network Service or in the canonical format, "NT AUTHORITY\NETWORK SERVICE".
As you ponted out, you won't see this account with the Users manager. This
is a predefined system account, like the System (TCB) account. The Network
Service account is a low priviledge account so if you change this account in
the AppPool Identity option for another with more priviledges, be carefull
with a possible "Elevation of Priviledge Threat".
--
Eng. Hernan de Lahitte - MSDE
Lagash Systems S.A. - Buenos Aires, Argentina
[url]http://www.lagash.com[/url]
"jzink" <zinks.home@verizon.net> wrote in message
news:076701c3d4cb$1e7e7740$a101280a@phx.gbl...> what do you mean by appPoll account and how come I don't
> see nt authority\network service as a user in computer
> management\users ??
>> be you case. The> >-----Original Message-----
> >This is the default AppPoll Account for W2K3. This might> ().Name> >ASPNET account is the default for an XP box or lower.
> >
> >--
> >Eng. Hernan de Lahitte - MSDE
> >Lagash Systems S.A. - Buenos Aires, Argentina
> >[url]http://www.lagash.com[/url]
> >
> >
> >
> >"jzink" <zinks.home@verizon.net> wrote in message
> >news:00ac01c3d48a$fe49a340$a601280a@phx.gbl...> >> I changed the aspx code to print out
> >> System.Security.Principal.WindowsIdentity.GetCurre nt> you> >> and now i see NT AUTHORITY\NETWORK SERVICE. shouldn't i
> >> see aspnet ???
> >>
> >> >-----Original Message-----
> >> >If you want to see the identity of the worker process,
> >> that is, the account
> >> >that will be used to access your protected resource,> you> >> should use
> >> >System.Security.Principal.WindowsIdentity.GetCurr ent
> >> ().Name.
> >> >
> >> >This will return, in you case, the ASPNET account if> turn> >> turn off
> >> >impersonation, or your logged on user account if you> put> >> on impersonation.
> >> >
> >> >
> >> >
> >> >--
> >> >Eng. Hernan de Lahitte - MSDE
> >> >Lagash Systems S.A. - Buenos Aires, Argentina
> >> >[url]http://www.lagash.com[/url]
> >> >
> >> >
> >> >
> >> >"jzink" <zinks.home@verizon.net> wrote in message
> >> >news:096201c3d468$ab769af0$a601280a@phx.gbl...
> >> >> I do not have impersonation set to true, yet when I> for> >> >> this code into my aspx page:
> >> >> Response.Write (
> >> >> Thread.CurrentPrincipal.Identity.Name.ToString() )
> >> >> it will write out the name of the user who was
> >> >> authenticated not ASPNET. What am I missing ???
> >> >>
> >> >> >-----Original Message-----
> >> >> >You will want to grant access to the ASPNET account> [url]www.sysinternals.com[/url].> >> >> deleting the file.
> >> >> >If you want only the authenticated user to have the
> >> >> ability to delete the
> >> >> >file then you could simply set impersonation to true
> >> and
> >> >> set permissions
> >> >> >for that logged on user. If you do this and you are
> >> still
> >> >> having problems,
> >> >> >a good way to troubleshoot would be to use filemon
> >> while
> >> >> you repro any
> >> >> >errors. You can download it from> >> >> It
> >> >> will show you
> >> >> >what user is accessing what files and whether the
> >> access
> >> >> was successful or
> >> >> >not.
> >> >> >
> >> >> >This posting is provided "AS IS" with no warranties,
> >> and
> >> >> confers no rights.
> >> >> >
> >> >> >Holly
> >> >> >
> >> >> >.
> >> >> >
> >> >
> >> >
> >> >.
> >> >
> >
> >.
> >
Hernan de Lahitte Guest
-
Holly Mazerolle #11
Re: asp.net, basic authentication, file access
So in your case since you are on Win2003 and you are not using
impersonation the NT Authority\Network Service account will be who is
accessing the location you are attempting to delete files from. As I
mentioned before you may want to consider impersonation so that you only
give permission to a specific domain account.
This posting is provided "AS IS" with no warranties, and confers no rights.
Holly
Holly Mazerolle Guest



Reply With Quote

