Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > User Authentication - LogonUserIdentity

Reply
Thread Tools

User Authentication - LogonUserIdentity

 
 
mario.colorado@gmail.com
Guest
Posts: n/a
 
      11-29-2006
Hi!

Does anyone know why it is that when I use:

Request.LogonUserIdentity.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

 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      11-29-2006
LogonUserIdentity 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/
===================================
<> wrote in message
news: oups.com...
> Hi!
>
> Does anyone know why it is that when I use:
>
> Request.LogonUserIdentity.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
>



 
Reply With Quote
 
 
 
 
mario.colorado@gmail.com
Guest
Posts: n/a
 
      11-29-2006
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:
> LogonUserIdentity 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/
> ===================================
> <> wrote in message
> news: oups.com...
> > Hi!
> >
> > Does anyone know why it is that when I use:
> >
> > Request.LogonUserIdentity.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
> >


 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      11-29-2006
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... -->
<authentication mode="windows">

<!-- For Forms Authentication... -->
<authentication 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 "machinename/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/
===================================
<> wrote in message
news: oups.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:
> LogonUserIdentity 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/
> ===================================
> <> wrote in message
> news: oups.com...
> > Hi!
> >
> > Does anyone know why it is that when I use:
> >
> > Request.LogonUserIdentity.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
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Incorrect LogonUserIdentity.Name Scott_A ASP .Net Security 6 08-23-2010 04:29 PM
802.11 X port-level authentication or user-level authentication zillah Wireless Networking 0 11-09-2006 10:00 AM
Failed Authentication, Status "Unsupported Authentication Algorithm" Rafael Cisco 1 11-26-2004 03:57 PM
Moving from Baisc Authentication to Forms Authentication raj mandadi ASP .Net 0 12-22-2003 12:16 AM
Forms Authentication, external authentication server, & rerouting to orig. req. URL Andrew Connell ASP .Net 1 10-21-2003 05:41 PM



Advertisments