I have been trying to figure out the right magic word to find how to get the network login name on my aspx project. The Authentication mode in the web.config is set to “Windows” so I’d like to get the login name of the person going to the intranet application, so they don’t have to type in name and password. I know there’s a way to do this, so can anyone either a)give me the magic name of the field or b)suggest how I might capture this name? Thanks!
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
gettting login name
Home » Forums » Developers, developers, developers » Web design and development » gettting login name
- This topic has 12 replies, 4 voices, and was last updated 18 years, 10 months ago.
AuthorTopicWSgarbsmj
AskWoody LoungerJuly 20, 2006 at 12:26 pm #433793Viewing 5 reply threadsAuthorReplies-
WSHansV
AskWoody Lounger -
WSgarbsmj
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSJezza
AskWoody LoungerJuly 20, 2006 at 9:13 pm #1021312Okey doke
What you need then is the WindowsIdentity class which has the following parameters:
AuthenticationType ie Basic or NTLM (for Windows integrated Authentication)
IsAnonymous
IsAuthenticated
IsGuest
IsSystem
Name
TokenTo display the user account associated with the current user you could use:
Response.Write ( User.Identity.Name)
This displays the full user account including the domain.
After that I get a bit hazy but it may get you started
-
WSgarbsmj
AskWoody LoungerJuly 24, 2006 at 12:48 pm #1021756Jerry,
I looked at the WindowsIdentity class and it referrred to mscorlib.dll I loaded the .dll into my references but sadly, no username reference appeared under the System.Security.Principal. So I went out and spent the rent money on a huge ASP 1.1 book that, if all else fails, I can fling at my flat-screen and put it out of its misery.
I’ll let you and everyone else know once I figure this out. It can’t be nearly as difficult as it appears, right?
-
-
-
WSJezza
AskWoody LoungerJuly 20, 2006 at 9:16 pm #1021314…and then using every reference at his disposal I find a link which may be useful
http://docs.instantasp.com/InstantForum/de…tion_roles.html%5B/url%5D
-
WSjscher2000
AskWoody LoungerJuly 20, 2006 at 4:24 pm #1021275I haven’t done any .Net development, so this might be too “old school” but IIS itself can determine the type of authentication used to access an ASP application. If you choose “Windows Integrated Authentication” (or whatever it is called after IIS 4.x) then IE will automatically log the user in using the credentials from their current session of Windows. This presumes the user has not disabled this feature in the applicable security zone, e.g., Intranet zone. (In Firefox, you have to add a browser preference to enable this.)
WSJezza
AskWoody LoungerJuly 20, 2006 at 8:17 pm #1021307WSJezza
AskWoody LoungerWSgarbsmj
AskWoody LoungerJuly 20, 2006 at 8:48 pm #1021309I guess I forgot to mention a few things…..
1. I’m using VB.NET and ASPX.NET. Every example of trying to get the user’s network name is unhandily written in C# and although I can read it okay, I’m also in charge of documenting the application and other people might not get the sudden shift in technologies (especially when they start with Void).
2. I’ve figured out how to manipulate the web.config to block users and/or groups. However, I need this security on the forms,as well as in general.
3. The end users want to see their name on the form they’re using. So like Manager Joe wants to see a screen with all his accounts and “Manager Joe” at the top. I can get the name from the network id from a table, but darn it, I can’t figure out how to get the network id.
Does this make more sense? I do appreciate everyone’s suggestions, really I do.
WSgarbsmj
AskWoody LoungerJuly 24, 2006 at 7:06 pm #1021872Okay! I got it! See, I knew I wasn’t saying the magic word…here’s what I did.
1. I put at the beginning of the html .
2. my sql database (test mode) didn’t have the correct groups set up. So fortunately, I knew how to point the groups to the database.
3. my web.config allowed everybody (*) in the section. By putting just my domain name and user name I was able to get “You are bleepPeggy” to display on the form. Bleep, of course, represents the name of my domain. I can easily strip off the “bleep” so I’m just left with Peggy.
-
WSJezza
AskWoody Lounger
Viewing 5 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Sometimes I wonder about these bots
by
Susan Bradley
1 hour, 26 minutes ago -
Does windows update component store “self heal”?
by
Mike Cross
7 hours, 31 minutes ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
8 hours, 31 minutes ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
7 hours, 56 minutes ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
4 hours, 26 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
11 hours, 13 minutes ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
11 hours, 14 minutes ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
5 hours, 7 minutes ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
19 hours, 22 minutes ago -
0Patch, where to begin
by
cassel23
13 hours, 24 minutes ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
1 day, 9 hours ago -
89 million Steam account details just got leaked,
by
Alex5723
20 hours, 45 minutes ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
1 day, 17 hours ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
1 day, 8 hours ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
19 hours, 39 minutes ago -
Installer program can’t read my registry
by
Peobody
2 hours, 19 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
1 day, 6 hours ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
1 day, 13 hours ago -
False error message from eMClient
by
WSSebastian42
2 days, 4 hours ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
2 days, 13 hours ago -
Office 2021 Perpetual for Mac
by
rebop2020
2 days, 14 hours ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
1 hour, 35 minutes ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
2 days, 18 hours ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
1 hour, 55 minutes ago -
Outdated Laptop
by
jdamkeene
2 days, 23 hours ago -
Updating Keepass2Android
by
CBFPD-Chief115
3 days, 5 hours ago -
Another big Microsoft layoff
by
Charlie
3 days, 5 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
7 hours, 8 minutes ago -
May 2025 updates are out
by
Susan Bradley
8 hours, 50 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
3 days, 11 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.