Q:

My MongoDB authentication config is not working

I installed MongoDB using homebrew on my mac.  
And I created admin account on my local mongodb.  
Then, I added below code to my 'mongod.conf' to use authentication mode.  
The code is 'security: authorization: enabled'. 
systemLog:
  destination: file
  path: /usr/local/var/log/mongodb/mongo.log
  logAppend: true
storage:
  dbPath: /usr/local/var/mongodb
net:
  bindIp: 127.0.0.1
security:
  authorization: enabled

And I restarted MongoDB. ' brew services restart mongodb'
But whenever I start mongo shell, it still print 
WARNING: Access control is not enabled for the database. 
Read and write access to data and configuration is unrestricted. 

And naturally it can be used without user connection. 
How can I resolve this problem? 
If I type
db.auth("username", "password")

It print '1'.  <- authenticated. 
Is it impossible to authenticate mongoDB if I use homebrew? 
I don't know what I have to do anymore. 
Please, Help me. 
Thank you. 

+ It's full log
MongoDB shell version v4.0.3
connecting to: mongodb://127.0.0.1:27017
Implicit session: session { "id" : UUID("573560e4-0a3a-472e-a94a-79b1cecab4fd") }
MongoDB server version: 4.0.3
Server has startup warnings: 
2019-08-27T19:02:40.847+0900 I CONTROL  [initandlisten] 
2019-08-27T19:02:40.847+0900 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database. 
2019-08-27T19:02:40.847+0900 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted. 
2019-08-27T19:02:40.847+0900 I CONTROL  [initandlisten] 
---
Enable MongoDB's free cloud-based monitoring service, which will then receive and display
metrics about your deployment (disk utilization, CPU, operation statistics, etc). 

The monitoring data will be available on a MongoDB website with a unique URL accessible to you
and anyone you share the URL with.  MongoDB may use this information to make product
improvements and to suggest MongoDB products and deployment options to you. 

To enable free monitoring, run the following command: db.enableFreeMonitoring()
To permanently disable this reminder, run the following command: db.disableFreeMonitoring()

A:

try removing the current service
enable authorization first in the config file and then run mongod daemon for the very first time. 
mongo allows "localhost exception".  Read about it in the documentation
then create first account with required privileges on the admin database.  Make sure to include privileges of creating other users. 
restart mongod daemon. 

check if error goes away..
point is to enable authorization before creating any user, even before admin. 

A:

I don't see you have specified the Authentication Mechanism in config file.  Please add it to your mongod config file
security:
  authorization: enabled

setParameter:
  authenticationMechanisms: SCRAM-SHA-1

Once the above is done, restart your mongo instance and that should work

