Class SaslAuthenticator
- Namespace
- MongoDB.Driver.Core.Authentication
- Assembly
- MongoDB.Driver.Core.dll
Base class for a SASL authenticator.
public abstract class SaslAuthenticator : IAuthenticator
- Inheritance
-
SaslAuthenticator
- Implements
- Derived
- Inherited Members
Constructors
SaslAuthenticator(ISaslMechanism)
Initializes a new instance of the SaslAuthenticator class.
[Obsolete("Use the newest overload instead.")]
protected SaslAuthenticator(SaslAuthenticator.ISaslMechanism mechanism)
Parameters
mechanismSaslAuthenticator.ISaslMechanismThe mechanism.
SaslAuthenticator(ISaslMechanism, ServerApi)
Initializes a new instance of the SaslAuthenticator class.
protected SaslAuthenticator(SaslAuthenticator.ISaslMechanism mechanism, ServerApi serverApi)
Parameters
mechanismSaslAuthenticator.ISaslMechanismThe mechanism.
serverApiServerApiThe server API.
Properties
DatabaseName
Gets the name of the database.
public abstract string DatabaseName { get; }
Property Value
- string
The name of the database.
Name
Gets the name of the authenticator.
public string Name { get; }
Property Value
- string
The name.
Methods
Authenticate(IConnection, ConnectionDescription, CancellationToken)
Authenticates the connection.
public virtual void Authenticate(IConnection connection, ConnectionDescription description, CancellationToken cancellationToken)
Parameters
connectionIConnectionThe connection.
descriptionConnectionDescriptionThe connection description.
cancellationTokenCancellationTokenThe cancellation token.
AuthenticateAsync(IConnection, ConnectionDescription, CancellationToken)
Authenticates the connection.
public virtual Task AuthenticateAsync(IConnection connection, ConnectionDescription description, CancellationToken cancellationToken)
Parameters
connectionIConnectionThe connection.
descriptionConnectionDescriptionThe connection description.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task
A Task.
CustomizeInitialHelloCommand(BsonDocument)
Optionally customizes hello or legacy hello command.
public virtual BsonDocument CustomizeInitialHelloCommand(BsonDocument helloCommand)
Parameters
helloCommandBsonDocumentInitial command.
Returns
- BsonDocument
Optionally mutated command.