Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NT User Authentication?

Status
Not open for further replies.

Junior1544

Technical User
Apr 20, 2001
1,267
US
I am building a web app for the first time(I've been tasked with it not long ago)...

What I am looking at now is securing the web app... I have been required to use nt authentication...

How will I be able to use the current users user name in code?? I have been programming with vba for ms access and in that I use:
currentuser()
Is there some thing close to that I can use??

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
James,

there are alot of walkthroughs and tutorials about this. You are looking for ASP.NET Form Authentication.
With the right settings in your web.config file and the right settings in the IIS, you will be able to use an object such as:

[c#]
WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
strUserName = wp.Identity.Name;


ref:
good luck! Daren J. Lahey
Just another computer guy...
If you are unsure of forum etiquette check here FAQ796-2540
 
Be sure to set up your directory security properly, too.

Turn off anonymous, and turn on Basic & Integrated

This will give you access to the user name of the logged in NT user via:

request.servervariables("auth_user")

or

User.Identity.Name

This is, of course, assuming you want to use windows authentication. Alcar's demo there is a forms authentication example (which is arguably better -- if it works for you)
penny1.gif
penny1.gif
 
the main problem as i see it is this.

I will just be in charge of the web pages... a sys admin/web master for the etire organization is in charge of security and the site maintanence and backup's... I just need to write the pages and design the table structure...

Unforunatly it's taking me a while to be able to talk to the web master directly... soon i hope...

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Well, when it comes to authentication and security, you will need the web server sys admin. It's a team task. My best suggestion is to find enough documentation to foward to the sys admin with your explanation attached to it.

good luck! Daren J. Lahey
Just another computer guy...
If you are unsure of forum etiquette check here FAQ796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top