Table of Contents

Class MongoCredential

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Credential to access a MongoDB database.

[Serializable]
public class MongoCredential : IEquatable<MongoCredential>
Inheritance
MongoCredential
Implements
Inherited Members

Constructors

MongoCredential(string, MongoIdentity, MongoIdentityEvidence)

Initializes a new instance of the MongoCredential class.

Properties

Evidence

Gets the evidence.

Identity

Gets the identity.

Mechanism

Gets the mechanism to authenticate with.

Password

Gets the password.

Source

Gets the source.

Username

Gets the username.

Methods

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.

CreateCredential(string, string, string)

Creates a default credential.

CreateGssapiCredential(string)

Creates a GSSAPI credential.

CreateGssapiCredential(string, SecureString)

Creates a GSSAPI credential.

CreateGssapiCredential(string, string)

Creates a GSSAPI credential.

CreateMongoCRCredential(string, string, SecureString)

Creates a credential used with MONGODB-CR.

CreateMongoCRCredential(string, string, string)

Creates a credential used with MONGODB-CR.

CreateMongoX509Credential(string)

Creates a credential used with MONGODB-X509.

CreateOidcCredential(IOidcCallback, string)

Creates a credential used with MONGODB-OIDC.

CreateOidcCredential(string, string)

Creates a credential used with MONGODB-OIDC.

CreatePlainCredential(string, string, SecureString)

Creates a PLAIN credential.

CreatePlainCredential(string, string, string)

Creates a PLAIN credential.

Equals(MongoCredential)

Compares this MongoCredential to another MongoCredential.

Equals(object)

Compares this MongoCredential to another MongoCredential.

GetHashCode()

Gets the hashcode for the credential.

GetMechanismProperty<T>(string, T)

Gets the mechanism property.

ToString()

Returns a string representation of the credential.

WithMechanismProperty(string, object)

Creates a new MongoCredential with the specified mechanism property.

Operators

operator ==(MongoCredential, MongoCredential)

Compares two MongoCredentials.

operator !=(MongoCredential, MongoCredential)

Compares two MongoCredentials.