Class MongoDBCRAuthenticator
- Namespace
- MongoDB.Driver.Core.Authentication
- Assembly
- MongoDB.Driver.Core.dll
A MONGODB-CR authenticator. This authenticator was replaced by ScramSha1Authenticator in MongoDB 3.0, and is now deprecated.
[Obsolete("This authenticator was replaced by ScramSha1Authenticator in MongoDB 3.0, and is now deprecated.")]
public sealed class MongoDBCRAuthenticator : IAuthenticator
- Inheritance
-
MongoDBCRAuthenticator
- Implements
- Inherited Members
Constructors
MongoDBCRAuthenticator(UsernamePasswordCredential)
Initializes a new instance of the MongoDBCRAuthenticator class.
public MongoDBCRAuthenticator(UsernamePasswordCredential credential)
Parameters
credential
UsernamePasswordCredentialThe credential.
MongoDBCRAuthenticator(UsernamePasswordCredential, ServerApi)
Initializes a new instance of the MongoDBCRAuthenticator class.
public MongoDBCRAuthenticator(UsernamePasswordCredential credential, ServerApi serverApi)
Parameters
credential
UsernamePasswordCredentialThe credential.
serverApi
ServerApiThe server API.
Properties
MechanismName
Gets the name of the mechanism.
public static string MechanismName { get; }
Property Value
- string
The name of the mechanism.
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 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 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 BsonDocument CustomizeInitialHelloCommand(BsonDocument helloCommand)
Parameters
helloCommand
BsonDocumentInitial command.
Returns
- BsonDocument
Optionally mutated command.