2.4.1. Password Authentication
2.4.1.1. Backend Configuration
First, add the following directive to wmr-site.xml
to enable password authentication support:
<property>
<name>wmr.server.httpauth.enable</name>
<value>true</value>
</property>
Next, we need to set up the password list. By default, account names and passwords are stored in a file named accounts.properties
in the $WMR_HOME/conf
directory. The format is a standard Java properties file with account names as keys and usernames as values.
Important
Be careful about storing passwords with punctuation: as in all Java properties files, some characters need to be escaped, and due to the way the embedded Jetty webserver processes values in this file, commas are not allowed. See the file accounts.properties.example
for details.
Add accounts for each of your frontend installations by adding lines similar to the following:
username
: password
Finally, restart your backend to reload the configuration:
$ cd $WMR_HOME
$ bin/stop-wmr.sh
$ bin/start-wmr.sh
2.4.1.2. Frontend Configuration
Set the appropriate username and password by the following lines to include/settings.php
, which will enable password authentication automatically:
$wmrUser = 'username
';
$wmrPass = 'password
';
Important
Since you are now storing passwords in the include/settings.php
file, make sure this file is only readable by the webserver.
Try submitting a job to check that everything is working properly. WebMapReduce should now be protected from unauthorized submissions.