Web Wiz - Solar Powered Eco Web Hosting

  New Posts New Posts RSS Feed - IIS Question
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

IIS Question

 Post Reply Post Reply
Author
sF|Shmaff View Drop Down
Newbie
Newbie
Avatar

Joined: 04 November 2002
Location: Canada
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote sF|Shmaff Quote  Post ReplyReply Direct Link To This Post Topic: IIS Question
    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:

www.websitename.com is entered by the user;

User is prompted for usrename and password;

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

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

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
neotrix View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 09 November 2003
Location: Pakistan
Status: Offline
Points: 433
Post Options Post Options   Thanks (0) Thanks(0)   Quote neotrix Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 24 August 2004 at 4:15am
He's talking about windows authentication in ASP
Back to Top
scottage View Drop Down
Newbie
Newbie


Joined: 20 August 2004
Location: United Kingdom
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote scottage Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4671
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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
%>

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.07
Copyright ©2001-2024 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2024 Web Wiz Ltd. All rights reserved.