There is an authentication chapter of the official specification for mongo clients: https://github.com/mongodb/specifications/blob/master/source/auth/auth.rst
Apart from the username and password, we have other settings such as the authentication database (admin by default) and the mechanism (we have the SCRAM-SHA-1 only for now). I may be okay to follow their suggestion of having a MongoCredential class (or hierarchy).
The spec also specifies a handshake sending a isMaster as the first operation after a socket is open by the pool, and some behavior.
There is an authentication chapter of the official specification for mongo clients: https://github.com/mongodb/specifications/blob/master/source/auth/auth.rst Apart from the username and password, we have other settings such as the authentication database (admin by default) and the mechanism (we have the SCRAM-SHA-1 only for now). I may be okay to follow their suggestion of having a
MongoCredential
class (or hierarchy).The spec also specifies a handshake sending a
isMaster
as the first operation after a socket is open by the pool, and some behavior.