How to read a user id

  • Thread starter Thread starter Dave Tichenor
  • Start date Start date
D

Dave Tichenor

We are using windows authication (ADS) for a Sharepoint Portal web Site.

How can get the user who log in - we have a asp.net form that emails - and
would like to automically put them name in the message - so we know who it
came from.

thanks
 
Request.ServerVariables("LOGON_USER")

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Hi Dave,


Thanks for posting in the community!
From your description, you'd like to get the loged user's
username(idenitity) in your ASP.NET web application. And you're using the
Windows Authentication and also integrated the share-point portal
server,yes?
If there is anything I misunderstood, please feel free to let me know.

As for this problem, I think Kevin's suggestion that use the
Request.ServerVariables("LOGON_USER") is reasonable since the
Request.ServerVariables collection has many useful infos, more detailed
info on them, you can view the following reference in MSDN:

#Request.ServerVariables Collection
http://msdn.microsoft.com/library/en-us/iissdk/iis/ref_vbom_reqocsv.asp?fram
e=true

In addtion, as you're using the Windows Authentication in ASP.NET you can
also try the "HttpContext.Current.User"
it also contained the currently authenticated user's info. Here is the
detailed description on it in MSDN:

#HttpContext.User Property
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwebhttpcontext
classusertopic.asp?frame=true

and here is another tech article discussing on the Authentication and
Authorization model in ASP.NET:
#Authentication and Authorization
http://msdn.microsoft.com/library/en-us/dnadvnet/html/vbnet10282003.asp?fram
e=true

Hope they're helpful.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Hi Dave,


Have you had a chance to try out the suggestions in my last reply or have
you got any further ideas on this issue? If you have any questions or need
any further assitance, please feel free to post here.



Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Back
Top