Authenticate user for mongo database
Mongodb sample taken from mongodb driver code