NodeBrain TM Webster Module Tutorial

Password Authentication

For a real NodeBrain application, we want to use Webster as an interface to a NodeBrain agent, and perhaps for configuring NodeBrain rules using CGI scripts.   But first we need to provide some form of user authentication to limit access to a small number of application administrators.   We'll start with basic password authentication.

First kill your webster1 process and execute webster2. (If you have problems, you can always go back to using webster1 to access this page again.)

    $ ./webster2
The webster2 file will differ from webster1 in the highlighted text below.
    #!/usr/bin/nb -d
    # File: tutorial/webster/webster2
    set out=".",log="webster.log";
    define webster node webster);
    webster. define uri cell "http://0.0.0.0:62443";
    webster. define Authenticate cell "password";   # Default is "yes"
    webster. define AccessList   cell "security/AccessList.conf";
    set traceWebster;
    

Click on your browser's refresh button and you should get a prompt for the user and password.   Enter user "webster" and password "2torial". These values have been configured in the tutorial/Webster/security/AccessList.conf file included in the distribution.

Warning: Using a default configuration like this is not actually secure because anyone with this documentation has access using the default tutorial port, user and password. So you should not leave webster2 running with default values for a long period.

Changing or Adding Passwords

Although, HTTP basic authentication is not recommended, you can improve it a bit by changing the password. If you don't plan to use basic authentication, you can skip this section, but remember to kill your webster2 process at the end of this tutorial.

If you look in your tutorial/Webster/log/webster.log you will see an entry like this.

    Authorization: Basic d2Vic3RlcjoydG9yaWFs
The funny string is an encoding of the user "webster" and password "2torial" that your browser performs. Webster accepts this user and password because it is configured in tutorial/Webster/security/AccessList.conf.
    # Webster Access List
    # Format:
    #
    #   role,userid; [# comment]
    #
    #   role: a - administrator
    #         b - browser
    #
    a,d2Vic3RlcjoydG9yaWFs; # webster:2torial
    
The easiest way to change the user and password is to:
  1. Bookmark this page.
  2. Close all browser windows.
  3. Open your browser.
  4. Use the bookmark to return to this page.
  5. When requested to enter a user and password, provide new values.
  6. After your authentication fails with the new values, enter the defaults of "webster" and "2torial".
  7. Look in your tutorial/Webster/log/webster.log file for the "Authorization: Basic" entry having a different value than shown above.
  8. Copy and paste this value into your AccessList.conf file as shown below.
  9. Kill your webster2 process and restart it.
  10. Close all browser windows.
  11. Open your browser.
  12. Use the bookmark to return to this page.
  13. When requested to enter a user and password, provide the new values.
  14. This time you should successfully authenticate with the new user and password.
    # Webster Access List
    # Format:
    #
    #   role,userid; [# comment]
    #
    #   role: a - administrator
    #         b - browser
    #
    #a,d2Vic3RlcjoydG9yaWFs; # webster:2torial
    a,new-value; 
    

Copyright © 2014 NodeBrain.org