home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / srev13h.zip / dynpwd.doc < prev    next >
Text File  |  1999-10-31  |  5KB  |  109 lines

  1. 22 April 1999. Daniel Hellerstein (danielh@crosslink.net)
  2.  
  3.                 DYNPWD: The SRE-http DYNamic PassWorD facility
  4.  
  5. 1) Abstract:
  6.  
  7. SREF_DYNAMIC_PWD, which is part of SRE-http version 1.3d,
  8. is a procedure designed to be used by SRE-http addons.
  9. It is purpose is to provide "digest" style authentication to http/1.0 browsers 
  10. (i.e.; Netscape 4.0 and below). As opposed to "basic" authentication, 
  11. DYNPWD (as well as "digest" authentication) never sends a user's password 
  12. in the clear.  Instead, a strongly encrypted version of the password is
  13. sent, an encryption that changes from seesion to session (that is,
  14. from day to day and from IP-address to IP-address).
  15.  
  16. This encryption does NOT extend to the contents of the request, hence
  17. DYNPWD (as well as "digest" authentication") is not as powerful as 
  18. SSL. Nevertheless, by keeping the password secret from prying eyes,
  19. most "man in the middle" attacks can be prevented.
  20.  
  21.   If you are interested in encryption of responses, please see
  22.   ENCRYPT.DOC for a description of SRE-http's encryption facility.
  23.         
  24.         
  25.  
  26. 2) Usage:
  27.  
  28. To use SREF_DYNAMIC_PWD, you must 
  29.  a) have version 1.3d (or above) of SRE-http
  30. You should also have
  31.  b) a copy of DYNPWD.RSP in the (possibly host-specific) "data directory" for
  32.    this server  (the root of your web tree). 
  33.    This is not strictly required -- you can specify a different "response" file.
  34.  
  35. Using DYNPWD requires two steps:
  36.   a) grant "application specific, secret privileges" to the lucky clients.
  37.      For example, since the MANAGER addon can use SREF_DYNAMIC_PWD,
  38.      you might have:
  39.         user = DAN
  40.         password= THEMAN
  41.      and a privset= PRIV1 ?MANAGER:doxfiles
  42.      
  43.     Note the use of the ?MANAGER:xxxx syntax: the ? signals that this is
  44.     a "secret privilege", and the MANAGER: means "this privilege is
  45.     for use by the MANAGER addon.
  46.  
  47.     The substring fallowing the ?appname: (for example, "doxfiles")
  48.     is the "shared secret" for the appname addon.
  49.  
  50.  
  51.   b) Write an appication that requires dynamic passwords. This is 
  52.      actually quite easy, it just requires one call to SREF_DYNAMIC_PWD.
  53.  
  54.  
  55.   c) Optional -- customize DYNPWD.RSP. This is strictly optional -- the
  56.                  generic version of DYNPWD.RSP should work without
  57.                  any modification.
  58.  
  59. 2) Syntax of SREF_DYNAMIC_PWD
  60.  
  61. To enable dynamic passwords, you must write an "sre-http" addon that
  62. calls the SREF_DYNAMIC_PWD procedure (SREF_DYNAMIC_PWD is loaded 
  63. into macrospace when needed).  
  64.  
  65. The calling syntax for SREF_DYNAMIC_PWD is:
  66.   res=sref_dynamic_pwd(appname,newlocation,privset2,duration,respfile,clientaddr)
  67. where
  68.   appname: recommended. the "application" calling this. Used to identify 
  69.            a "shared secret". If not specified, a value DYNPWD is used.
  70.            Note that APPNAME is also used in responses.
  71.   newlocation: recommended. The uri to invoke when client hits the submit
  72.                button. Default value is "/"
  73.   privset2 : REQUIRED. the space delimited list of "secret" privileges. 
  74.              It should contain an entry of the form APPNAME:shared_secret
  75.   duration: optional. duration of a timestamp, in days (and fractions of day)
  76.              (default value is 1 day)
  77.   respfile: optional.the "response file" containing the md5 procedure. If not
  78.             specified, DYNPWD.RSP, in the datadir(), is used.
  79.   clientaddr: client's numeric ip address. Optional, if missing, will get if
  80.             with a GOSERVE extract 
  81. and
  82.   resp='' 
  83.          if a valid password is found
  84. or 
  85.   resp='200 '||length(response) 
  86.         if no valid password is found, 
  87.         sref_dynamic_pwd asks the client to supply one -- this is the
  88.         response code for this "response"
  89.  
  90.  
  91. Thus, if SREF_DYNAMIC_PWD returns a '', the client is legit. If
  92. it returns anything else, then SREF_DYNAMIC_PWD has sent a "please
  93. enter password" response, and has closed the connection.
  94.  
  95. 3) Notes
  96.  
  97.   * For an example of SREF_DYNAMIC_PWD, see the SRE-http "MANAGER" addon.
  98.  
  99.   * For further discussion of "secret privileges", see the SRE-http manual,
  100.     or the USERS.IN file that comes with SRE-http.
  101.  
  102.   * The "privset" argument (to SRE-http addons) is divided into
  103.     two sections: the "public" privileges (that may be reported
  104.     by the STATUS, and other, addons), and the "secret" privileges
  105.     (that should NEVER be reported by any SRE-http addon).
  106.     To obtain them, use:
  107.       parse var privset privset_public ',' privset_secret
  108.  
  109.