From: Alan T on 14 Jul 2010 03:17 ASP.NET 4.0 I tried to get the Windows Logon user by: HttpContext.Current.User.Identity.Name.ToString(); But it return empty. What I want to do is to get the full name of the logon user from Active Directory.
From: Harlan Messinger on 14 Jul 2010 12:40 Alan T wrote: > ASP.NET 4.0 > > I tried to get the Windows Logon user by: > > HttpContext.Current.User.Identity.Name.ToString(); > > But it return empty. > > What I want to do is to get the full name of the logon user from Active > Directory. > Are you using authentication before allowing access to the application? Or is this a website with anonymous user access, where you happen to be logged into Windows on your machine while you are accessing the site, thinking the application will know which Windows user you are?
From: Alan T on 14 Jul 2010 19:08 >> ASP.NET 4.0 >> >> I tried to get the Windows Logon user by: >> >> HttpContext.Current.User.Identity.Name.ToString(); >> >> But it return empty. >> >> What I want to do is to get the full name of the logon user from Active >> Directory. >> > > Are you using authentication before allowing access to the application? Or > is this a website with anonymous user access, where you happen to be > logged into Windows on your machine while you are accessing the site, > thinking the application will know which Windows user you are? Hi, At the moment, I am just testing by running within VWD 2010 Express (locally) by pressing F5, and the Anonymous access disabled in IIS. I can use these to find out my logon user: string strName = Request.ServerVariables["LOGON_USER"]; Response.Write(strName); It gives me, for example, that's correct: mydomain\smithj
From: Harv on 21 Jul 2010 14:16 On Jul 14, 5:08 pm, "Alan T" <alan_NO_SPAM_pl...(a)yahoo.com.au> wrote: > >> ASP.NET 4.0 > > >> I tried to get the Windows Logon user by: > > >> HttpContext.Current.User.Identity.Name.ToString(); > > >> But it return empty. > > >> What I want to do is to get the full name of the logon user from Active > >> Directory. > > > Are you using authentication before allowing access to the application? Or > > is this a website with anonymous user access, where you happen to be > > logged into Windows on your machine while you are accessing the site, > > thinking the application will know which Windows user you are? > > Hi, > > At the moment, I am just testing by running within VWD 2010 Express > (locally) by pressing F5, and the Anonymous access disabled in IIS. > > I can use these to find out my logon user: > string strName = Request.ServerVariables["LOGON_USER"]; > > Response.Write(strName); > > It gives me, for example, that's correct: > > mydomain\smithj Alan, Do you have the Integrated Windows Authentication checked for the site?
|
Pages: 1 Prev: Config Transforms with Web Deployment Projects in ASP.net Next: objectdatasource |