Click or drag to resize

MongoCredential Class

Credential to access a MongoDB database.
Inheritance Hierarchy
SystemObject
  MongoDB.DriverMongoCredential

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.16.0+eeafbea0921243a5868b81984e1083a07c1f75bc
Syntax
[SerializableAttribute]
public class MongoCredential : IEquatable<MongoCredential>

The MongoCredential type exposes the following members.

Constructors
  NameDescription
Public methodMongoCredential
Initializes a new instance of the MongoCredential class.
Top
Properties
  NameDescription
Public propertyEvidence
Gets the evidence.
Public propertyIdentity
Gets the identity.
Public propertyMechanism
Gets the mechanism to authenticate with.
Public propertyPassword Obsolete.
Gets the password.
Public propertySource
Gets the source.
Public propertyUsername
Gets the username.
Top
Methods
  NameDescription
Public methodStatic memberCreateCredential(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 methodStatic memberCreateCredential(String, String, String)
Creates a default credential.
Public methodStatic memberCreateGssapiCredential(String)
Creates a GSSAPI credential.
Public methodStatic memberCreateGssapiCredential(String, SecureString)
Creates a GSSAPI credential.
Public methodStatic memberCreateGssapiCredential(String, String)
Creates a GSSAPI credential.
Public methodStatic memberCreateMongoCRCredential(String, String, SecureString) Obsolete.
Creates a credential used with MONGODB-CR.
Public methodStatic memberCreateMongoCRCredential(String, String, String) Obsolete.
Creates a credential used with MONGODB-CR.
Public methodStatic memberCreateMongoX509Credential
Creates a credential used with MONGODB-X509.
Public methodStatic memberCreatePlainCredential(String, String, SecureString)
Creates a PLAIN credential.
Public methodStatic memberCreatePlainCredential(String, String, String)
Creates a PLAIN credential.
Public methodEquals(MongoCredential)
Compares this MongoCredential to another MongoCredential.
Public methodEquals(Object)
Compares this MongoCredential to another MongoCredential.
(Overrides ObjectEquals(Object).)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Gets the hashcode for the credential.
(Overrides ObjectGetHashCode.)
Public methodGetMechanismPropertyT
Gets the mechanism property.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string representation of the credential.
(Overrides ObjectToString.)
Public methodWithMechanismProperty
Creates a new MongoCredential with the specified mechanism property.
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Compares two MongoCredentials.
Public operatorStatic memberInequality
Compares two MongoCredentials.
Top
Extension Methods
  NameDescription
Public Extension MethodToBson
Serializes an object to a BSON byte array.
(Defined by BsonExtensionMethods.)
Public Extension MethodToBsonDocument
Serializes an object to a BsonDocument.
(Defined by BsonExtensionMethods.)
Public Extension MethodToJson
Serializes an object to a JSON string.
(Defined by BsonExtensionMethods.)
Top
See Also