This version of the documentation supports the 3.2 version of BMC Digital Workplace Basic. Click here to view the documentation for the current version.

Storing the MongoDB password in encrypted format in the configuration file

As an additional security measure, you can encrypt the MongoDB password instead of storing it in plain text.

Video demonstration

The following video (4:10) demonstrates how to restrict MongoDB access by enabling authentication and store the encrypted MongoDB password in the configuration file:

To store the MongoDB password in encrypted format in the configuration file

  1. Run the setmongodbpassword.js script in \social\scripts\:
    1. If you have already set the MongoDB username and password in the Smart_IT_MyIT/social/config.js file, remove the username and password:

      Original value New value
      mongodb://social_admin:yourPassword@ipAddress:portNumber/ mongodb://<ip_address>:<port>/
    2. Open the command prompt window and navigate to the MyIT_SmartIT installation folder\social\scripts directory.

    3. Run the setmongodbpassword.js script in pathToNodeExecutable\binary. 
      (Windows) node.exe setmongodbpassword.js mongodbUsername mongodbPassword
      (Linux) node setmongodbpassword.js mongodbUsername mongodbPassword

      After the setmongodbpassword.js script runs, the social\config.js file is updated with the following attributes:

      "db_username": "social_admin", //user_name of DB
      "db_pw": "2738327c3d7eb81bc40b57c818dcbd62", // password is encrypted using the auto generated cipher and will be handled in the application to decrypt.
      "db_auth": true // Is set to true for authentication of mongoDB on the application.
  2. Restart the social service.
Was this page helpful? Yes No Submitting... Thank you