One of my friends mailed on our INETA User Group mailing list asking that he is unable to recieve the name associated with Windows Identity object in his asp.net web application. He further claimed that he had set “authentication mode” to “windows authentication”.
Following was my response to that:
check that if the current user is authenticated or not. u may try this if block:
and if u come to know that the user is not authenticated (which i am sure u will find) then this means that like most of us u have enabled anonymous access. try disabling it and then run ur code by selecting windows authentication mode in your directory security settings in IIS.