User management

If you have decided to apply authentication to your PureWeb application, you can edit the user-service.properties file to add and remove users, as well as to assign security roles and passwords.

Some of the procedures on this page require a generated encoded password. On Windows, you can use an encoding tool that uses a SHA1 algorithm to produce an encoded password in a base64 format, such as SHA1_Calculator or quickhash. On Linux, use the new-password command to generate encoded passwords:
$ echo -n "new-password" | openssl dgst -sha1 -binary | openssl base64

A note about encoding for the files discussed on this page:

The PureWeb server assumes ISO 8859-1 encoding for properties files, which creates issues for non-latin characters in usernames and passwords.

To work around this, after you added a username or password with non-ISO 8859-1 characters, use Java's native2ascii tool to convert non-supported characters to Unicode escape characters. This is a tool that you run from the command line, with the following parameters:

native2ascii [input file][output file]

For this to work, you will need to first create a copy of the file and rename it; this will be your input file. The output file is the one that is needed by the PureWeb server, and it must be called user-service.properties.


Adding users

This procedure requires a generated encoded password, as described in the introduction to this topic.

  1. Navigate to the following file and open it in a text editor:
    [installed_directory]\Server\webapp\WEB-INF\user-service.properties
  2. Scroll down the file until you see a line in the following format:
    [username]=[encodedpassword],[roles],enabled
  3. Copy and paste that line and edit it using the information applicable to the user you are adding, for example:
    janedoe=0DPiKuNIrrVmD8IUCuw1hQxNqZc=,ROLE_PUREWEB_USER,enabled
  4. Click Save to commit the changes, then close the file.
  5. Run Java's native2ascii tool on the file, if you used non-latin characters.
  6. Restart the server for the changes to take effect.

Changing a user's password

You can follow this procedure to change the password for any user. For users with the administrator security role, it is also possible to change the password directly in the server's graphical interface. For more information, see Changing the administrator password.

This procedure requires a password encoded in SHA1, as described in the introduction to this topic.

  1. Navigate to the following file and open it in a text editor:
    [installed_directory]\Server\webapp\WEB-INF\user-service.properties
  2. Scroll down the file until you see the line for the user whose password you want to change, for example:
    janedoe=0DPiKuNIrrVmD8IUCuw1hQxNqZc=,ROLE_PUREWEB_USER,enabled
  3. Overwrite the existing password with the new one.
  4. Click Save to commit the changes, then close the file.
  5. Run Java's native2ascii tool on the file, if you used non-latin characters.
  6. Restart the server for the changes to take effect.

Changing a user's role

This procedure allows you to change a user's security role. Note that it is possible for a user to have more than one role.

  1. Navigate to the following file and open it in a text editor:
    [installed_directory]\Server\webapp\WEB-INF\user-service.properties
  2. Scroll down the file until you see the line for the user whose role you want to change, for example:
    janedoe=0DPiKuNIrrVmD8IUCuw1hQxNqZc=,ROLE_PUREWEB_USER,enabled
  3. Overwrite the existing role or add a new one.
  4. Click Save to commit the changes, then close the file.
  5. Restart the server for the changes to take effect.

Removing or disabling users

You can temporarily disable a user, or remove the user permanently.

  1. Navigate to the following file and open it in a text editor:
    [installed_directory]\Server\webapp\WEB-INF\user-service.properties
  2. Scroll down the file until you see the line for the user you want to remove or edit, for example:
    janedoe=0DPiKuNIrrVmD8IUCuw1hQxNqZc=,ROLE_PUREWEB_USER,enabled
  3. Do one of the following:

    • To remove the user, delete the line entirely.
    • To temporarily disable the user, replace the enabled parameter at the end with the value disabled.

  4. Click Save to commit the changes, then close the file.
  5. Restart the server for the changes to take effect.

Changing the administrator password

After you have installed the PureWeb server, you should change the default administrator password.

  1. Log into the server and navigate to the Configuration page by clicking on the Configuration link.
  2. Scroll down to the bottom of the page, until you see the Administration section.
  3. Click the Change Administrator Password link to open for editing.
  4. Enter your old and new password information in the fields provided. New passwords must be at least 9 characters long.
  5. Click the Change Password button.

You must perform a reload or restart the server before server configuration or plug-in file changes take effect.

To perform a reload, navigate to the server's Configuration page and click the Reload button for the section where the file is located within the page (for example, if you edited a plug-in configuration file, click the Reload Plugins button, if you edited a logging configuration file, click the Reload Logging button, and so on).

If you edit a configuration file, the server will display a reload required message beside this file in the Configuration page as a reminder until the changes have been applied.