re:
now I get the machinename/defaultusername for the PC I'm running the IIS in.
Is this normal?
Are you sure you enabled Windows Authentication ?
http://aspnet.4guysfromrolla.com/articles/031204-1.aspx
The method of authentication to use is specified in the Web application's Web.config file:
<!-- For Windows Authentication. .. -->
<authenticati on mode="windows">
<!-- For Forms Authentication. .. -->
<authenticati on mode="forms">
The only form of authentication which will return individual user names is Windows Authentication.
More info on Windows Authentication is found here:
http://msdn.microsoft.com/library/de...onprovider.asp
If you are getting "machinenam e/defaultusername ", you are impersonating that identity.
For code examples showing how to implement impersonation in an ASP.NET application, see:
http://support.microsoft.com/default...;EN-US;Q306158
General info on ASP.NET Authenticatoin is at :
http://msdn.microsoft.com/library/de...onprovider.asp
There's a step-by-step guide to ASP.NET Web Application Security at :
http://msdn.microsoft.com/library/de...onsecurity.asp
re:
I thought I would get my domain/username
The only way you could get "domain/anyusername"
is if users of your app are challenged for credentials.
Juan T. Llibre, asp.net MVP
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en español :
http://asp.net.do/foros/
=============== =============== =====
<ma************ @gmail.comwrote in message
news:11******** **************@ n67g2000cwd.goo glegroups.com.. .
Thanks! I tried it and now I get the machinename/defaultusername for
the PC I'm running the IIS in. Is this normal?
I thought I would get my domain/username, since i'm viewing the page
from a different PC.
Juan T. Llibre wrote:
LogonUserIdenti ty only returns a true user name if Windows Authentication is used.
http://msdn2.microsoft.com/en-us/lib...ridentity.aspx
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== =====
<ma************ @gmail.comwrote in message
news:11******** **************@ l12g2000cwl.goo glegroups.com.. .
Hi!
Does anyone know why it is that when I use:
Request.LogonUs erIdentity.User .ToString()
I get something like:
S-1-5-21-2268419........ ..
I was expecting to get the username of the person looking at the page.
Is it possible to convert the output I get to the username such as
john_smith
Thanks!
MC