asp login, I need help please!! Newbie

P

Patrick Hill

Hey, I am running a server 2003 website that uses basic
authentication. I installed a asp web application that requires a
login and password. Is there a way that I can use alter the code on
the login page of the web application to accept the credentials of our
website basic authentication? If so how can I do it. This is my
first time trying anything like this and any help would be greatly
appretated.

Thanks
Patrick
 
R

Rick Strahl [MVP]

Hi Patrick,

Sure, the old fashioned way <g>

You need to send an Http header to prompt for basic auth then check the
Remote_User var for a logged in value:

string RemoteUser =Request.ServerVariables["Remote_User"];
if (RemoteUser == null || RemoteUser.Length == 0)
{
Response.Clear();
Response.StatusCode = 401;
Response.StatusDescription="Unauthorized";
Response.AddHeader("WWW-Authenticate","BASIC");
Response.End();
}

.... logged in code...


+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
 
P

Patrick Hill

Rick,
Thanks for the response. Should I create a new page with that code or
should I add it to the exsisting login page of the web app?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top