Method CreateCredential
CreateCredential(string, string, string)
Creates a default credential.
public static MongoCredential CreateCredential(string databaseName, string username, string password)
Parameters
databaseNamestringName of the database.
usernamestringThe username.
passwordstringThe password.
Returns
- MongoCredential
A default credential.
CreateCredential(string, string, SecureString)
Creates a default credential. Less secure when used in conjunction with SCRAM-SHA-256, due to the need to store the password in a managed string in order to SaslPrep it.
public static MongoCredential CreateCredential(string databaseName, string username, SecureString password)
Parameters
databaseNamestringName of the database.
usernamestringThe username.
passwordSecureStringThe password.
Returns
- MongoCredential
A default credential.