Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 12th, 2006, 05:19 PM
Authorized User
 
Join Date: Apr 2005
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Default Grabbing user login info

Hey all,

I really aint a beginner anymore but this seems like a beginner question as I am having a hard time finding the answer. On a company network in the same domain, I want my web apps to be user aware. Meaning when someone hits my site, I can grab their login name or string. Not the password, i want windows to take care of all the authentication, I just want to know who it is. This is on an intranet. I have tried the WindowsIdentity class but found some strange results. When I test it in VS2K5, I get the results I want as it knows me. I put it up on the app server and hit it and it comes back with the NT AUTHORITY hehe. Anyone wanna nudge me in the right direction?

 
Old May 12th, 2006, 07:06 PM
Authorized User
 
Join Date: Apr 2005
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I hate when I post a question and find the answer. So, just so everyone can know what i was doing wrong.

WindowIdentity, HttpContext and Thread can all get back a user's login info from the browser but they all work differently according to what you have configured in the Web.Config. My issue was missing the impersonate line which has to be true with Windows authentication for WindowIdentity to grab the current user's info. You can find this info I found here on MSDN site and worth looking at if you ever going to work for a company who doesn't want their users logging into every site. Works good too if you have the SIDs for the groups in AD for your network as you can even make pages group based based on the SIDs. This model makes me able to build the pages and have someone else administer the rights by just knowign Active Directory hehe. Also, i don't have to mess with LDAP this way. Any, info on the impersonation stuff is here.

http://msdn.microsoft.com/library/de...SecNetAP05.asp







Similar Threads
Thread Thread Starter Forum Replies Last Post
Help passing login info to new page peterh Classic ASP Basics 4 January 10th, 2008 12:39 PM
Passing NT Login Info negrette Classic ASP Professional 1 October 25th, 2004 02:37 PM
login failed for user nt authority\anonymous login rj1406 Classic ASP Databases 1 October 24th, 2004 09:15 AM
How do I store user login info to use in a form? lanctotd Classic ASP Basics 1 July 15th, 2003 08:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.