{"id":8120,"date":"2021-03-10T21:54:02","date_gmt":"2021-03-10T18:54:02","guid":{"rendered":"https:\/\/kifarunix.com\/?p=8120"},"modified":"2024-04-21T10:47:41","modified_gmt":"2024-04-21T07:47:41","slug":"enable-authentication-on-mongodb","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/enable-authentication-on-mongodb\/","title":{"rendered":"Enable Authentication on MongoDB"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1011\" height=\"385\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/enable-auth-mongodb.png\" alt=\"Enable Authentication on MongoDB\" class=\"wp-image-8121\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/enable-auth-mongodb.png?v=1615402160 1011w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/enable-auth-mongodb-768x292.png?v=1615402160 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/enable-auth-mongodb-150x57.png?v=1615402160 150w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/enable-auth-mongodb-300x114.png?v=1615402160 300w, https:\/\/kifarunix.com\/wp-content\/uploads\/2021\/03\/enable-auth-mongodb-696x265.png?v=1615402160 696w\" sizes=\"(max-width: 1011px) 100vw, 1011px\" \/><\/figure><\/div>\n\n\n<p>In this guide, you will learn how to enable authentication on MongoDB database. Authentication is one of the access controls which ensures that whoever needs to access any data on the MongoDB database has to verify that they are who they claim they are using their user account passwords.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#enabling-authentication-on-mongo-db\">Enabling Authentication on MongoDB<\/a><ul><li><a href=\"#create-mongo-db-administrative-user\">Create MongoDB Administrative User<\/a><\/li><li><a href=\"#enable-access-control-on-mongo-db\">Enable Access Control on MongoDB<\/a><\/li><li><a href=\"#verifying-mongo-db-authentication\">Verifying MongoDB Authentication<\/a><\/li><li><a href=\"#reference\">Reference<\/a><\/li><li><a href=\"#other-tutorials\">Other Tutorials<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<p>Learn how to install MongoDB on Linux by following the link below;<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/?s=install+mongo\" target=\"_blank\" rel=\"noreferrer noopener\">How to Install MongoDB on Linux<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"enabling-authentication-on-mongo-db\">Enabling Authentication on MongoDB<\/h2>\n\n\n\n<p>By default, self hosted MongoDB doesn&#8217;t enforce user authentication by default. For example, when you connect to MongoDB from the command line using the <strong><code>mongo<\/code>sh<\/strong> or command <code><strong>mongosh mongodb:\/\/127.0.0.1:27017<\/strong><\/code>, you will connect with no prompt for authentication.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mongosh<\/pre>\n\n\n\n<p>Or<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mongosh mongodb:\/\/127.0.0.1:27017<\/pre>\n\n\n\n<p>This gets you directly onto the default MongoDB database shell prompt.<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>Current Mongosh Log ID:\t6624b6e86d2da8a9e3c934dc\nConnecting to:\t\tmongodb:\/\/127.0.0.1:27017\/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.4\nUsing MongoDB:\t\t7.0.8\nUsing Mongosh:\t\t2.2.4\n\nFor mongosh info see: https:\/\/docs.mongodb.com\/mongodb-shell\/\n\n------\n   The server generated these startup warnings when booting\n   2024-04-21T06:10:47.674+00:00: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http:\/\/dochub.mongodb.org\/core\/prodnotes-filesystem\n   2024-04-21T06:10:48.114+00:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted\n------\n\ntest>\n<\/code><\/pre>\n\n\n\n<p>This basically means that, any one with access to the system, can do anything possible to MongoDB databases since there is no restriction implemented.<\/p>\n\n\n\n<p>For example, once can list the databases;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">show dbs<\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>admin   40.00 KiB\nconfig  72.00 KiB\nlocal   40.00 KiB\n<\/code><\/pre>\n\n\n\n<p>So, how can you enabling authentication?<\/p>\n\n\n\n<p>There are several security features that can be implemented to secure MongoDB deployments. One of these features is the ability to enable MongoDB access control through enforcement of user authentication.<\/p>\n\n\n\n<p>Authentication is the process of validating the identity of a user connecting to a MongoDB.<\/p>\n\n\n\n<p>MongoDB uses various authentication mechanisms such as;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Salted Challenge Response Authentication Mechanism (SCRAM) which is the default MongoDB authentication mechanism. It <em>verifies the supplied user credentials against the user\u2019s&nbsp;<code>name<\/code>,&nbsp;<code>password<\/code>&nbsp;and&nbsp;<code>authentication&nbsp;database<\/code><\/em>.<\/li>\n\n\n\n<li>x.509 Certificate Authentication, which authenticates clients using x.509 certificates instead of usernames and passwords.<\/li>\n\n\n\n<li>And many <a href=\"https:\/\/www.mongodb.com\/docs\/manual\/core\/authentication\/#authentication-mechanisms\" target=\"_blank\" rel=\"noreferrer noopener\">other mechanisms<\/a>.<\/li>\n<\/ul>\n\n\n\n<p>In this guide, we will learn how to enable MongoDB authentication using SCRAM method, which involves the use of usernames and passwords to validate users identity.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-mongo-db-administrative-user\">Create MongoDB Administrative User<\/h3>\n\n\n\n<p>To begin with, connect to a MongoDB instance and create a MongoDB administrative user.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mongosh<\/pre>\n\n\n\n<p>If you check from MongoDB shell prompt, no user is created by default;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">show users<\/pre>\n\n\n\n<p>Or<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">db.getUsers();<\/pre>\n\n\n\n<p>The commands above prints no result.<\/p>\n\n\n\n<p>To create an admin user, switch to default <strong>admin<\/strong> MongoDB database.<\/p>\n\n\n\n<p>Listing available databases first;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">show dbs<\/pre>\n\n\n\n<p>Sample output;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>admin   40.00 KiB\nconfig  72.00 KiB\nlocal   40.00 KiB\n<\/code><\/pre>\n\n\n\n<p>Next, run the command below from the shell prompt to switch to MongoDB default <strong>admin<\/strong> database;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">use admin<\/pre>\n\n\n\n<p>Once you have switched to admin database, paste the command below on the shell to create MongoDB admin user.<\/p>\n\n\n\n<p><strong>Be sure to replace the username of the administrator as you wish<\/strong>.<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>db.createUser(\n  {\n    user: \"kifarunixAdmin\",\n    pwd: passwordPrompt(),\n    roles: [ { role: \"userAdminAnyDatabase\", db: \"admin\" }, \"readWriteAnyDatabase\" ]\n  }\n)\n<\/code><\/pre>\n\n\n\n<p>Press Enter once you have pasted the command call above. You will be prompted to enter your password. If you need to display the password in cleartext, simply replace <code><strong>passwordPrompt()<\/strong><\/code> with &#8220;<strong><code>your password<\/code><\/strong>&#8220;.<\/p>\n\n\n\n<p>The command above simply create an admin user with the following roles;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>roles<\/strong>: This field specifies the roles assigned to the user. Roles define the user&#8217;s permissions and privileges within the MongoDB database.\n<ul class=\"wp-block-list\">\n<li>{<strong> role: &#8220;userAdminAnyDatabase&#8221;, db: &#8220;admin&#8221; }<\/strong>: Grants the user administrative privileges (userAdminAnyDatabase) on the admin database. This role allows the user to create and manage users on any database.<\/li>\n\n\n\n<li><strong>&#8220;readWriteAnyDatabase&#8221;<\/strong>: Grants the user read and write access (readWriteAnyDatabase) to any database. This role allows the user to read and write data to any database in the MongoDB instance.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>Sample output of creating an admin user on MongoDB;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>******{ ok: 1 }<\/code><\/pre>\n\n\n\n<p>List users again to confirm;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>show users<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>[\n  {\n    _id: 'admin.kifarunixAdmin',\n    userId: UUID('766ca619-b033-4f21-983c-9454b36e3449'),\n    user: 'kifarunixAdmin',\n    db: 'admin',\n    roles: [\n      { role: 'readWriteAnyDatabase', db: 'admin' },\n      { role: 'userAdminAnyDatabase', db: 'admin' }\n    ],\n    mechanisms: [ 'SCRAM-SHA-1', 'SCRAM-SHA-256' ]\n  }\n]\n<\/code><\/pre>\n\n\n\n<p>Once you have created an admin user, exit the database connection;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">quit ()<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"enable-access-control-on-mongo-db\">Enable Access Control on MongoDB<\/h3>\n\n\n\n<p>MongoDB provides an option, <code><strong>security.authorization<\/strong><\/code>, for enabling or disabling role based access control (RBAC).<\/p>\n\n\n\n<p>To enable this option, edit MongoDB configuration file, <code><strong>\/etc\/mongod.conf<\/strong><\/code>, and set the value for this option to <strong><code>enabled<\/code><\/strong>.<\/p>\n\n\n\n<p>Open the file for editing;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo vim \/etc\/mongod.conf<\/pre>\n\n\n\n<p>Update the line, <strong><code>#security<\/code><\/strong>, to look like;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>security:\n    authorization: enabled<\/code><\/pre>\n\n\n\n<p>Your config should look like;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code># network interfaces\nnet:\n  port: 27017\n  bindIp: 127.0.0.1\n\n\n# how the process runs\nprocessManagement:\n  timeZoneInfo: \/usr\/share\/zoneinfo\n\n<strong>#security:\nsecurity:\n    authorization: enabled<\/strong>\n\n#operationProfiling:\n\n<\/code><\/pre>\n\n\n\n<p>Save and exit the file.<\/p>\n\n\n\n<p>Restart MongoDB service;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl restart mongod<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"verifying-mongo-db-authentication\">Verifying MongoDB Authentication<\/h3>\n\n\n\n<p>Next, to verify if authentication works, connect to MongoDB;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mongosh<\/pre>\n\n\n\n<p>If you get the error;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>Current Mongosh Log ID:\t6624bb0d8db6dfae65c934dc\nConnecting to:\t\tmongodb:\/\/127.0.0.1:27017\/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.4\nMongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017\n<\/code><\/pre>\n\n\n\n<p>Then MongoDB is not running;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status mongod<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\u00d7 mongod.service - MongoDB Database Server\n     Loaded: loaded (\/usr\/lib\/systemd\/system\/mongod.service; enabled; preset: enabled)\n     Active: failed (Result: exit-code) since Sun 2024-04-21 07:06:38 UTC; 24s ago\n   Duration: 35ms\n       Docs: https:\/\/docs.mongodb.org\/manual\n    Process: 10918 ExecStart=\/usr\/bin\/mongod --config \/etc\/mongod.conf (code=exited, status=14)\n   Main PID: 10918 (code=exited, status=14)\n        CPU: 32ms\n\nApr 21 07:06:38 noble-numbat systemd[1]: Started mongod.service - MongoDB Database Server.\nApr 21 07:06:38 noble-numbat mongod[10918]: {\"t\":{\"$date\":\"2024-04-21T07:06:38.032Z\"},\"s\":\"I\",  \"c\":\"CONTROL\",  \"id\":7484500, \"ctx\":\"main\",\"msg\":\"Environment variable MONGODB_CON>\nApr 21 07:06:38 noble-numbat systemd[1]: mongod.service: Main process exited, code=exited, status=14\/n\/a\nApr 21 07:06:38 noble-numbat systemd[1]: mongod.service: Failed with result 'exit-code'.\n<\/code><\/pre>\n\n\n\n<p>Check the log file for errors;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo grep -i error \/var\/log\/mongodb\/mongod.log<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>{\"t\":{\"$date\":\"2024-04-21T06:10:47.674+00:00\"},\"s\":\"I\",  \"c\":\"STORAGE\",  \"id\":22315,   \"ctx\":\"initandlisten\",\"msg\":\"Opening WiredTiger\",\"attr\":{\"config\":\"create,cache_size=1447M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,remove=true,path=journal,compressor=snappy),builtin_extension_config=(zstd=(compression_level=6)),file_manager=(close_idle_time=600,close_scan_interval=10,close_handle_minimum=2000),statistics_log=(wait=0),json_output=(error,message),verbose=[recovery_progress:1,checkpoint_progress:1,compact_progress:1,backup:0,checkpoint:0,compact:0,evict:0,history_store:0,recovery:0,rts:0,salvage:0,tiered:0,timestamp:0,transaction:0,verify:0,log:0],\"}}\n{\"t\":{\"$date\":\"2024-04-21T06:10:48.149+00:00\"},\"s\":\"I\",  \"c\":\"CONTROL\",  \"id\":20712,   \"ctx\":\"LogicalSessionCacheReap\",\"msg\":\"Sessions collection is not set up; waiting until next sessions reap interval\",\"attr\":{\"error\":\"NamespaceNotFound: config.system.sessions does not exist\"}}\n{\"t\":{\"$date\":\"2024-04-21T07:06:37.957+00:00\"},\"s\":\"I\",  \"c\":\"CONTROL\",  \"id\":23377,   \"ctx\":\"SignalHandler\",\"msg\":\"Received signal\",\"attr\":{\"signal\":15,\"error\":\"Terminated\"}}\n{\"t\":{\"$date\":\"2024-04-21T07:06:37.958+00:00\"},\"s\":\"W\",  \"c\":\"NETWORK\",  \"id\":23022,   \"ctx\":\"listener\",\"msg\":\"Unable to remove UNIX socket\",\"attr\":{\"path\":\"\/tmp\/mongodb-27017.sock\",\"error\":\"Operation not permitted\"}}\n{\"t\":{\"$date\":\"2024-04-21T07:06:38.040+00:00\"},\"s\":\"E\",  \"c\":\"NETWORK\",  \"id\":23024,   \"ctx\":\"initandlisten\",\"msg\":\"Failed to unlink socket file\",\"attr\":{\"path\":\"\/tmp\/mongodb-27017.sock\",\"error\":\"Operation not permitted\"}}\n{\"t\":{\"$date\":\"2024-04-21T07:09:01.260+00:00\"},\"s\":\"E\",  \"c\":\"NETWORK\",  \"id\":23024,   \"ctx\":\"initandlisten\",\"msg\":\"Failed to unlink socket file\",\"attr\":{\"path\":\"\/tmp\/mongodb-27017.sock\",\"error\":\"Operation not permitted\"}}\n{\"t\":{\"$date\":\"2024-04-21T07:14:45.327+00:00\"},\"s\":\"E\",  \"c\":\"NETWORK\",  \"id\":23024,   \"ctx\":\"initandlisten\",\"msg\":\"Failed to unlink socket file\",\"attr\":{\"path\":\"\/tmp\/mongodb-27017.sock\",\"error\":\"Operation not permitted\"}}\n{\"t\":{\"$date\":\"2024-04-21T07:21:23.655+00:00\"},\"s\":\"E\",  \"c\":\"NETWORK\",  \"id\":23024,   \"ctx\":\"initandlisten\",\"msg\":\"Failed to unlink socket file\",\"attr\":{\"path\":\"\/tmp\/mongodb-27017.sock\",\"error\":\"Operation not permitted\"}}\n{\"t\":{\"$date\":\"2024-04-21T07:30:04.411+00:00\"},\"s\":\"E\",  \"c\":\"NETWORK\",  \"id\":23024,   \"ctx\":\"initandlisten\",\"msg\":\"Failed to unlink socket file\",\"attr\":{\"path\":\"\/tmp\/mongodb-27017.sock\",\"error\":\"Operation not permitted\"}}\n<\/code><\/pre>\n\n\n\n<p>If you see such error, <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"msg\":\"Failed to unlink socket file\",\"attr\":{\"path\":\"\/tmp\/mongodb-27017.sock\",\"error\":\"Operation not permitted\"}}<\/code><\/pre>\n\n\n\n<p>The, remove the socket file and restart mongod service;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo rm -rf \/tmp\/mongodb-27017.sock<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart mongod<\/code><\/pre>\n\n\n\n<p>Ensure MongoDB is running;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ss -altnp | grep :27<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>LISTEN 0      4096       127.0.0.1:27017      0.0.0.0:*    users:((\"mongod\",pid=11780,fd=14))<\/code><\/pre>\n\n\n\n<p>Then login to the database;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mongosh<\/code><\/pre>\n\n\n\n<p>Try to list available database users;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">show users<\/pre>\n\n\n\n<p>You will get such an error that <strong>MongoServerError[Unauthorized]: Command usersInfo requires authentication<\/strong>.<\/p>\n\n\n\n<p>To authenticate as a user, switch to admin database;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">use admin<\/pre>\n\n\n\n<p>Next, run the command below to login as the administrative user created above (Replace the username accordingly);<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">db.auth(\"kifarunixAdmin\")<\/pre>\n\n\n\n<p>Similarly, you can authenticate directly to a specific database from command line;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mongosh -u &lt;username> -p &lt;password> --authenticationDatabase &lt;authDatabase> &lt;connectionString><\/pre>\n\n\n\n<p>Where:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;username><\/code>: Your MongoDB username.<\/li>\n\n\n\n<li><code>&lt;password><\/code>: Your MongoDB password.<\/li>\n\n\n\n<li><code>&lt;authDatabase><\/code>: The authentication database where the user credentials are stored.<\/li>\n\n\n\n<li><code>&lt;connectionString><\/code>: The connection string for your MongoDB server, including the hostname, port, and database name.<\/li>\n<\/ul>\n\n\n\n<p>E.g;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mongosh -u kifarunixAdmin -p --authenticationDatabase admin admin<\/code><\/pre>\n\n\n\n<p>Or<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mongosh -u kifarunixAdmin -p --authenticationDatabase admin mongodb:\/\/localhost:27017\/admin<\/code><\/pre>\n\n\n\n<p>Enter your password.<\/p>\n\n\n\n<p>Once connected to MongoDB, run the commands as you wish. e.g list available users;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">show users<\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>admin> show users\n[\n  {\n    _id: 'admin.kifarunixAdmin',\n    userId: UUID('766ca619-b033-4f21-983c-9454b36e3449'),\n    user: 'kifarunixAdmin',\n    db: 'admin',\n    roles: [\n      { role: 'readWriteAnyDatabase', db: 'admin' },\n      { role: 'userAdminAnyDatabase', db: 'admin' }\n    ],\n    mechanisms: [ 'SCRAM-SHA-1', 'SCRAM-SHA-256' ]\n  }\n]\n<\/code><\/pre>\n\n\n\n<p>You can further create databases and respective users and roles.<\/p>\n\n\n\n<p>That simply marks the end of our tutorial on how to enable MongoDB authentication.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"reference\">Reference<\/h3>\n\n\n\n<p><a aria-label=\"MongoDB Authentication (opens in a new tab)\" href=\"https:\/\/docs.mongodb.com\/manual\/core\/authentication\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"rank-math-link\">MongoDB Authentication<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"other-tutorials\">Other Tutorials<\/h3>\n\n\n\n<p><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-and-configure-sssd-for-openldap-authentication-on-fedora-32-31-30\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Install and Configure SSSD for OpenLDAP Authentication on Fedora 32\/31\/30<\/a><\/p>\n\n\n\n<p><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/configure-squid-proxy-openldap-authentication-on-pfsense\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Configure Squid Proxy OpenLDAP Authentication on pfSense<\/a><\/p>\n\n\n\n<p><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/configure-offline-authentication-via-openldap-on-macos-x\/\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Configure Offline Authentication via OpenLDAP on MacOS X<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/configure-openldap-authentication-on-macos-x\/\" target=\"_blank\" aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"rank-math-link\">Configure OpenLDAP Authentication on MacOS X<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, you will learn how to enable authentication on MongoDB database. Authentication is one of the access controls which ensures that whoever needs<\/p>\n","protected":false},"author":3,"featured_media":8121,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[299,121],"tags":[3225,3224,3220,961,3222,3221,3226,3223],"class_list":["post-8120","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database","category-howtos","tag-create-admin-user-mongodb","tag-create-user-mongodb","tag-enable-authentication-on-mongodb","tag-mongodb","tag-mongodb-admin-user","tag-mongodb-authentication","tag-mongodb-authentication-enabled","tag-mongodb-db-auth","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/8120"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=8120"}],"version-history":[{"count":3,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/8120\/revisions"}],"predecessor-version":[{"id":22233,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/8120\/revisions\/22233"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/8121"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=8120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=8120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=8120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}