Method CreateCredential
CreateCredential(string, string, string)
Creates a default credential.
public static MongoCredential CreateCredential(string databaseName, string username, string password)
Parameters
databaseName
stringName of the database.
username
stringThe username.
password
stringThe 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
databaseName
stringName of the database.
username
stringThe username.
password
SecureStringThe password.
Returns
- MongoCredential
A default credential.