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.7.3+Branch.v2.7.x.Sha.2f1f2be13a23b8520cb9c2ee8439c022f9a03efe
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. In .NET Standard, authenticating via SCRAM-SHA-256 may not work with non-ASCII passwords because SaslPrep is not fully implemented due to the lack of a string normalization function in .NET Standard 1.5. Normalizing the password into Unicode Normalization Form KC beforehand MAY help. SCRAM-SHA-1 is the recommended alternative for now.
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. In .NET Standard, authenticating via SCRAM-SHA-256 may not work with non-ASCII passwords because SaslPrep is not fully implemented due to the lack of a string normalization function in .NET Standard 1.5. Normalizing the password into Unicode Normalization Form KC beforehand MAY help. SCRAM-SHA-1 is the recommended alternative for now.
Public methodStatic memberCreateCredential(String, String, String)
Creates a default credential. In .NET Standard, authenticating via SCRAM-SHA-256 may not work with non-ASCII passwords because SaslPrep is not fully implemented due to the lack of a string normalization function in .NET Standard 1.5. Normalizing the password into Unicode Normalization Form KC beforehand MAY help. SCRAM-SHA-1 is the recommended alternative for now.
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(Object)
Compares this MongoCredential to another MongoCredential.
(Overrides ObjectEquals(Object).)
Public methodEquals(MongoCredential)
Compares this MongoCredential to another MongoCredential.
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