Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > System.Security.Principal.WindowsIdentity.GetCurre nt()

Reply
Thread Tools

System.Security.Principal.WindowsIdentity.GetCurre nt()

 
 
Jeremy Chapman
Guest
Posts: n/a
 
      09-08-2005
I have a web application which calls a web service, which calls a method in
an assembly of it's bin directory.
The web application and web service use windows authentication with windows
impersonation set in the web.config files. In IIS, these virtual
directories have anonymous access turned off.

I am debugging, and stepping through all the code, If I inspect
System.Security.Principal.WindowsIdentity.GetCurre nt().Name I will see my
windows account name and domain in both the web application and the web
service. But when I step into the code in the assembly being called by the
web service, the System.Security.Principal.WindowsIdentity.GetCurre nt().Name
contains my machine name. Why would code in the assembly run under a
different context?


 
Reply With Quote
 
 
 
 
Nicole Calinoiu
Guest
Posts: n/a
 
      09-09-2005
How are you invoking the code in the assembly that is "called by the web
service"?


"Jeremy Chapman" <(E-Mail Removed)> wrote in message
news:%23MDVe$(E-Mail Removed)...
>I have a web application which calls a web service, which calls a method in
>an assembly of it's bin directory.
> The web application and web service use windows authentication with
> windows impersonation set in the web.config files. In IIS, these virtual
> directories have anonymous access turned off.
>
> I am debugging, and stepping through all the code, If I inspect
> System.Security.Principal.WindowsIdentity.GetCurre nt().Name I will see my
> windows account name and domain in both the web application and the web
> service. But when I step into the code in the assembly being called by
> the web service, the
> System.Security.Principal.WindowsIdentity.GetCurre nt().Name contains my
> machine name. Why would code in the assembly run under a different
> context?
>



 
Reply With Quote
 
 
 
 
Jeremy Chapman
Guest
Posts: n/a
 
      09-09-2005
I reference the assembly from my web service project, and in the code of the
web method, I instatiate a class contained in that assembly and do a method
call.

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:(E-Mail Removed)...
> How are you invoking the code in the assembly that is "called by the web
> service"?
>
>
> "Jeremy Chapman" <(E-Mail Removed)> wrote in message
> news:%23MDVe$(E-Mail Removed)...
>>I have a web application which calls a web service, which calls a method
>>in an assembly of it's bin directory.
>> The web application and web service use windows authentication with
>> windows impersonation set in the web.config files. In IIS, these virtual
>> directories have anonymous access turned off.
>>
>> I am debugging, and stepping through all the code, If I inspect
>> System.Security.Principal.WindowsIdentity.GetCurre nt().Name I will see my
>> windows account name and domain in both the web application and the web
>> service. But when I step into the code in the assembly being called by
>> the web service, the
>> System.Security.Principal.WindowsIdentity.GetCurre nt().Name contains my
>> machine name. Why would code in the assembly run under a different
>> context?
>>

>
>



 
Reply With Quote
 
Nicole Calinoiu
Guest
Posts: n/a
 
      09-10-2005
Unless you've got a RevertToSelf or impersonation in there somewhere, this
is pretty odd since the code is presumably executing in the context of the
web service process. Might you be able to provide a simple sample ( la
http://www.yoda.arachsys.com/csharp/complete.html) that duplicates the
problem?


"Jeremy Chapman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I reference the assembly from my web service project, and in the code of
>the web method, I instatiate a class contained in that assembly and do a
>method call.
>
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
> news:(E-Mail Removed)...
>> How are you invoking the code in the assembly that is "called by the web
>> service"?
>>
>>
>> "Jeremy Chapman" <(E-Mail Removed)> wrote in message
>> news:%23MDVe$(E-Mail Removed)...
>>>I have a web application which calls a web service, which calls a method
>>>in an assembly of it's bin directory.
>>> The web application and web service use windows authentication with
>>> windows impersonation set in the web.config files. In IIS, these
>>> virtual directories have anonymous access turned off.
>>>
>>> I am debugging, and stepping through all the code, If I inspect
>>> System.Security.Principal.WindowsIdentity.GetCurre nt().Name I will see
>>> my windows account name and domain in both the web application and the
>>> web service. But when I step into the code in the assembly being called
>>> by the web service, the
>>> System.Security.Principal.WindowsIdentity.GetCurre nt().Name contains my
>>> machine name. Why would code in the assembly run under a different
>>> context?
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments