Print Page | Close Window

IIS Question

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=11611
Printed Date: 01 April 2026 at 5:44am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: IIS Question
Posted By: sF|Shmaff
Subject: IIS Question
Date Posted: 23 August 2004 at 7:36pm

I want to ask a user for particular credentials to gain access to my website (I'm using IIS only).  Currently I allow those with proper credentials to get access; however, based on who they are, I want to send them to a different page.

EG:

http://www.websitename.com - www.websitename.com is entered by the user;

User is prompted for usrename and password;

Based on input (EG: username = abc) simple redirect http://www.websitename.com/abc - www.websitename.com/abc

How can I access the username and/or password entered by the user in the Windows pop-up?




Replies:
Posted By: Mart
Date Posted: 24 August 2004 at 3:51am

You don't say whether you are using ASP or ASP.NET, in ASP.NET to get the username you  just go:

Dim strUsername As String = User.Identity.Name

I'm not certain how you do it in ASP. You cannot get the password though.



Posted By: neotrix
Date Posted: 24 August 2004 at 3:52am

if you are asking a script

<%

if Request("username")="abc" AND Request("password")="password" then

Response.Redirect("/abc/")

%>

you can keep on repeating this.. but seriously, i really dont get what you were asking



-------------
http://www.muhammadbinyusrat.com/blog/" rel="nofollow - Say to the believing men..


Posted By: Mart
Date Posted: 24 August 2004 at 4:15am
He's talking about windows authentication in ASP


Posted By: scottage
Date Posted: 26 August 2004 at 3:43pm

What about this? I'd use a session variable to know when a user is logged in or not, if they're logged in just redirect to request("script_name") & "/" & session("username") ... I'd guess that /username is a virtual directory otherwise you'll need a file (script) name too i.e. Response.ReDirect Request("Script_Name") & "/" & Session("username") & "/default.html". If you're using Integrated Security i.e. Windows Authentication then you can get the NT Account name from Request.ServerVariables("REMOTE_USER") (or similar - sometimes you get ("LOGON_USER") or ("AUTH_USER"), put this in your Session variable and off you go!

Scott Rickman
http://www.realwebdevelopers.com - http://www.realwebdevelopers.com



Posted By: michael
Date Posted: 26 August 2004 at 7:57pm

Why so complicated?
<%
Dim usr as string
usr = Request.ServerVariables("Logon_User")

If Not usr=Nothing THEN
Reponse.Redirect("/" & usr)
ELSE
Response.Redirect("accessdenied.html")
END IF
%>



-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net