Find the identity of client call WS

N

Nay

Hi
What is the best practice to find the identity(actually user name) of the
client that called the WS?
I use winform app that call WS. the WS run as anonymous on Win2003.
I guess that I should assign the credentials.
But which way:
s.Credentials = System.Net.CredentialCache.DefaultCredentials;
or
networkcredentialcache?

Furthermore, in the WS I saw many ways to get the user name.
I'm not sure about the difference, nad wheather this is the right way:
- System.Net.CredentialCache.DefaultCredentials.GetCredential
(HttpContext.Current.Request.Url,
HttpContext.Current.User.Identity.Name).UserName;
or
HttpContext.Current.User.Identity.Name;

Thanks
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top