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, 9 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
-
Outdated Laptop
by
jdamkeene
1 hour, 35 minutes ago -
Updating Keepass2Android
by
CBFPD-Chief115
3 hours, 56 minutes ago -
Another big Microsoft layoff
by
Charlie
3 hours, 36 minutes ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
3 hours, 25 minutes ago -
May 2025 updates are out
by
Susan Bradley
4 hours, 1 minute ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
9 hours, 40 minutes ago -
Windows 11 Insider Preview build 26120.3964 (24H2) released to BETA
by
joep517
9 hours, 42 minutes ago -
Drivers suggested via Windows Update
by
Tex265
9 hours, 33 minutes ago -
Thunderbird release notes for 128 esr have disappeared
by
EricB
7 hours, 17 minutes ago -
CISA mutes own website, shifts routine cyber alerts to X, RSS, email
by
Nibbled To Death By Ducks
16 hours, 32 minutes ago -
Apple releases 18.5
by
Susan Bradley
10 hours, 57 minutes ago -
Fedora Linux 40 will go end of life for updates and support on 2025-05-13.
by
Alex5723
17 hours, 58 minutes ago -
How a new type of AI is helping police skirt facial recognition bans
by
Alex5723
18 hours, 36 minutes ago -
Windows 7 ISO /Windows 10 ISO
by
ECWS
1 hour, 52 minutes ago -
No HP software folders
by
fpefpe
1 day, 2 hours ago -
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
35 minutes ago -
Stay connected anywhere
by
Peter Deegan
1 day, 7 hours ago -
Copilot, under the table
by
Will Fastie
22 hours, 53 minutes ago -
The Windows experience
by
Will Fastie
1 day, 13 hours ago -
A tale of two operating systems
by
Susan Bradley
1 day, 4 hours ago -
Microsoft : Resolving Blue Screen errors in Windows
by
Alex5723
1 day, 19 hours ago -
Where’s the cache today?
by
Up2you2
2 days, 10 hours ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
2 days, 3 hours ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
1 day, 3 hours ago -
Blocking Search (on task bar) from going to web
by
HenryW
5 hours, 54 minutes ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
3 days, 3 hours ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
3 days, 3 hours ago -
regarding april update and may update
by
heybengbeng
3 days, 5 hours ago -
MS Passkey
by
pmruzicka
2 days, 7 hours ago -
Can’t make Opera my default browser
by
bmeacham
3 days, 13 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.