Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET 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 April 13th, 2007, 02:34 PM
Registered User
 
Join Date: Dec 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to get windows user id in Forms Authentication

Hi,

   I use forms authentication in my application. One reason is troubleshooting and impersonating purposes for production support. In forms authentication we can log in as a differnet user as long as we know their credentials.If I use windows authentication, I won't be able to get the view of a different person's as I can't login as him/her.

Is there a way I can get the windows login id of the user while using forms authentication.

I have a small windows authenticated application where I use the following code to get the logged in windows user id. But I don't think that will give proper results with forms authentication.

WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
            strDUserName = wp.Identity.Name;

Thanks in advance.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Session ID swapping from user to user... greenwar VS.NET 2002/2003 3 September 7th, 2007 08:44 AM
How to get user name from windows authentication? su C# 1 December 9th, 2006 02:58 AM
Windows Authentication using db for user storage uneek_18 ASP.NET 1.0 and 1.1 Professional 5 June 16th, 2006 01:02 AM
Replace Forms with Windows Authentication sydneyausguy BOOK: ASP.NET Website Programming Problem-Design-Solution 0 December 21st, 2005 02:39 PM
Get USER ID in WINDOWS Application? Ron Howerton VB.NET 2002/2003 Basics 2 May 5th, 2005 02:13 PM





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