Subject: XML Webservice - Integrated windows authentication
Posted By: anees_ahamed Post Date: 10/4/2005 1:03:30 AM
Hi all,

I have a simple web method to return the current logon user id as follows

[WebMethod]
public string GetLogonUserID()
{
return System.Web.HttpContext.Current.Request.ServerVariables["LOGON_USER"];
}

If i call this web method by using IE testpage, it returns actual login user (domain\userid).

If i call this web method by using web refrence, it returns "domain\ASPNET"

Web method calling code:

WebApplication1.pws5.Service1 proxy = new WebApplication1.pws5.Service1();
proxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
proxy.PreAuthenticate = true;
System.String strRetVal = proxy.GetLogonUserID();
Response.Write(strRetVal);

Note: webservice is not anonymous and it is integrated windows authentication.

For reference please see the following authentication and authorization section of web.config

<authentication mode="Windows" />
<authorization>
<allow users="*" />
<deny users="?" />
</authorization>

If anybody could advice me any workaround to get actual NT login userid by calling above webmethod then it will be greatful.

Thanks in advance.

Thanks & Regards
Anees Ahamed.N.


Go to topic 647

Return to index page 460
Return to index page 459
Return to index page 458
Return to index page 457
Return to index page 456
Return to index page 455
Return to index page 454
Return to index page 453
Return to index page 452
Return to index page 451