0 Replies Latest reply on Aug 6, 2012 4:08 PM by dan_schiro

    In using the basic authentication with Nucleus WebServ how do you control which files require a user login?

    dan_schiro

      Symptoms

      • In using the basic authentication how do you control which files require a user login?

       

      • How could you force a login (basic authentication) at startup before any page is accessed?

       

      • How do I select which files are forced to use a login?

       

       

      Solution

       

      When you secure specific files, you
      have to place them in a secure directory.  So, in the converter you have
      to set the secure directory and then # that out in a macro.  See the
      notes below.

       

      To secure specific files with a log-in in WEBSERV, do the following:

      1. In ws_cfg.h, modify the following macro to point to the directory
      where all "private" files will be kept on the web server:

      #define WS_PRIVATE_DIR          "/privatedir"     

      * If you want to place your files in the default, that is fine.

      2. Use the file convert utility to generate all your "private" files
      into a C entry file.

      a. Open the utility
      b. Select all the "private" files
      c. Goto "Secure" -> "Set Directory"
      d. Choose the value to be the directory name chosen in step 1.
      e. At this point, the output file name is arbitrary, but to be
      consistent with the demo and to easily understand what this file is,
      name it "cfsd.c"

      3. Compile the generated C file.  This will contain your file and
      directory structure of your secured files.  Each file in this directory,
      will require a log-in authentication to be accessed.