J
John Lee
Hi,
I have a component with some static public methods and is it possible from
inside my method to decide if my component is invoked by an ASP.NET
application (such as web service) or a windows application? If YES, How to
do that?
If I know it's invoked by web service (web service is configured as windows
authentication only and assigned an application pool with NT domain account
as identity), Is the following assumption is 100% correct? or what is the
most reliable way of getting the authenticated user's name and the service
account's name?
1. Authenticated user will be
System.Threading.Thread.CurrentPrincipal.Identity.Name
2. Service account will be WindowsIdentity.GetCurrent().Name
If it's invoked by windows app, the authenticated user will be
WindowsIdentity.GetCurrent().Name, is this valid and reliable assumption?
Thanks a lot!
John
I have a component with some static public methods and is it possible from
inside my method to decide if my component is invoked by an ASP.NET
application (such as web service) or a windows application? If YES, How to
do that?
If I know it's invoked by web service (web service is configured as windows
authentication only and assigned an application pool with NT domain account
as identity), Is the following assumption is 100% correct? or what is the
most reliable way of getting the authenticated user's name and the service
account's name?
1. Authenticated user will be
System.Threading.Thread.CurrentPrincipal.Identity.Name
2. Service account will be WindowsIdentity.GetCurrent().Name
If it's invoked by windows app, the authenticated user will be
WindowsIdentity.GetCurrent().Name, is this valid and reliable assumption?
Thanks a lot!
John