URL Encoding for Special Characters in MongoDB User Names and Passwords

If you use special characters in a MongoDB username or password, such as a colon (:) or an at-sign (@), you must encode each special character to URL encoded format (percent encoding) when you set the username and password in MATRIXX configurations.

To avoid URL encoding, use only alpha-numeric characters in MongoDB user names and passwords.

When you use special characters in a MongoDB username or password, you must replace each special character with a percentage (%) followed by the two-character hexadecimal equivalent of the ASCII value.

For example, if you create a MongoDB user for running the Event Repository administration scripts, where the username is abc@123 (special character is at-sign) and the password is def:456 (special character is colon):

$ mongo -u MtxAdmin -p password admin
> db.createUser({user:"abc@123",pwd:"def:456",roles: [{role: "root", db: "admin"}]})
Successfully added user: {
    "user" : "abc@123",
    "roles" : [
        {
            "role" : "root",
            "db" : "admin"
        }
    ]
}

When you run an Event Repository administration script, you enter the user credentials using URL encoding as follows:

$ print_event_repository_stats.py
=======================================================================
print_event_repository_stats.py started on 2018-03-19 15:16:07
=======================================================================
Please enter user name:  abc%40123
Please enter password:  def%3a456
...

where:

  • %40 is the URL encoded format for the at-sign (@)
  • %3a is the URL encoded format for the colon (:)

The following are examples of MATRIXX configurations for which URL encoding on special characters must be used when setting user credentials for the components to connect to the Event Repository.

  • For the Event Loader (client) user of MATRIXX Engine, when configuring MATRIXX Engine and you answer the questions:
    • EventLoader:What is the username for the Event Repository?
    • EventLoader:What is the password for the Event Repository?
  • For the Event Repository administration scripts, when you:
    • Supply the username using the --user command or using the .mtx_event_repository_username file method
    • Supply the password when prompted by a script or when having it memorized (when saving the password for future authentication)
  • For the GL utilities (GL processor and GL posting utilities), when you:
    • Specify the username in each GL utility properties file.
    • Encrypt the password given to the user in each GL utility properties file by running the utility with the -p option.
  • For RS Gateway, when you specify the username and password to connect to the Event Repository in the rsgateway.yaml file.