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
mechanism
SaslAuthenticator.ISaslMechanismThe mechanism.
SaslAuthenticator(ISaslMechanism, ServerApi)
Initializes a new instance of the SaslAuthenticator class.
protected SaslAuthenticator(SaslAuthenticator.ISaslMechanism mechanism, ServerApi serverApi)
Parameters
mechanism
SaslAuthenticator.ISaslMechanismThe mechanism.
serverApi
ServerApiThe 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
connection
IConnectionThe connection.
description
ConnectionDescriptionThe connection description.
cancellationToken
CancellationTokenThe cancellation token.
AuthenticateAsync(IConnection, ConnectionDescription, CancellationToken)
Authenticates the connection.
public virtual Task AuthenticateAsync(IConnection connection, ConnectionDescription description, CancellationToken cancellationToken)
Parameters
connection
IConnectionThe connection.
description
ConnectionDescriptionThe connection description.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task
A Task.
CustomizeInitialHelloCommand(BsonDocument)
Optionally customizes hello or legacy hello command.
public virtual BsonDocument CustomizeInitialHelloCommand(BsonDocument helloCommand)
Parameters
helloCommand
BsonDocumentInitial command.
Returns
- BsonDocument
Optionally mutated command.