home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_06.cab / samp0hdf.asp < prev    next >
Text File  |  1997-10-15  |  3KB  |  42 lines

  1.  <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp0hdf.asp&srcfile=Interaction/Logon" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  3. <HTML>
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
  6. <title>Login Screens</title>
  7. <script language="JavaScript">
  8.  
  9.     szNavVersion = navigator.appVersion
  10.  
  11.     if (navigator.appName == "Microsoft Internet Explorer") {
  12.     if (szNavVersion.indexOf ("4.") >= 0) {
  13.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  14.     } else {
  15.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  16.     }
  17.     }
  18.     else if (navigator.appName == "Netscape") {
  19.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  20.     }
  21.     else {
  22.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  23.     }
  24.  
  25. </script>
  26. <META NAME="DESCRIPTION" CONTENT="Internet Information Server reference information"></HEAD>
  27. <BODY BGCOLOR=#FFFFFF TEXT=#000000>
  28. <font face="Verdana, Arial, Helvetica">
  29. <h3><a name="_login_screens"></a>Login Screens</h3>
  30. <p>
  31. This example illustrates how you can use ASP to leverage IIS and Windows NT® security features and authentication schemes to provide secure logon screens. </p>
  32. <p>
  33. The bulk of the initial authentication should, if possible, take place before any of the content has actually been sent to the client browser. This example demonstrates one method for accomplishing this. For the purposes of demonstration, this script simply gets the LOGON_USER variable from the <b>Request.ServerVariables</b> property, and checks that the user has been authenticated by the user's local server. An actual application could just as easily check the username and password against a database at this point in the script. </p>
  34. <p>
  35. If the user making the request, with the client browser, has not been authenticated, this script bars access to them. <b>Response.Status</b> is set to the HTTP 401 error code, indicating that there has been an access problem, and the <b>Response.End</b> method is then called, which ceases script processing and terminates the connection. </p>
  36. <p>
  37. If the user has bee authenticated, the rest of the Web page is sent to the client browser as usual. This sample uses the <b>Request.ServerVariables</b> twice more to retrieve some information on your current logon and authentication status. </p>
  38. <hr class="iis" size="1">
  39. <p align="center"><em><a href="/iishelp/common/colegal.htm">© 1997 by Microsoft Corporation. All rights reserved.</a></em></p>
  40. </BODY>
  41. </HTML>
  42.