I have installed mongodb and enabled auth. and its working find. I can connect it from remote notebook using robomongo application:
Host: SERVER_IP
PORT: 270
For pymongo,
Try below for MongoDB 4:
Add authSource : This is the name of the database that has the collection with the user credentials.
Ex:
client = MongoClient(host=<>,
port=<>,
username=<>,
password=<>,
authSource="admin")
db_obj = client[db_name]
Edit 1: I have tried this on Mongo 3.x version as well. Working for that too.