Table of Contents

Class MongoDBX509Authenticator

Namespace
MongoDB.Driver.Core.Authentication
Assembly
MongoDB.Driver.Core.dll

A MongoDB-X509 authenticator.

public sealed class MongoDBX509Authenticator : IAuthenticator
Inheritance
MongoDBX509Authenticator
Implements
Inherited Members

Constructors

MongoDBX509Authenticator(string)

Initializes a new instance of the MongoDBX509Authenticator class.

[Obsolete("Use the newest overload instead.")]
public MongoDBX509Authenticator(string username)

Parameters

username string

The username.

MongoDBX509Authenticator(string, ServerApi)

Initializes a new instance of the MongoDBX509Authenticator class.

public MongoDBX509Authenticator(string username, ServerApi serverApi)

Parameters

username string

The username.

serverApi ServerApi

The 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 IConnection

The connection.

description ConnectionDescription

The connection description.

cancellationToken CancellationToken

The cancellation token.

AuthenticateAsync(IConnection, ConnectionDescription, CancellationToken)

Authenticates the connection.

public Task AuthenticateAsync(IConnection connection, ConnectionDescription description, CancellationToken cancellationToken)

Parameters

connection IConnection

The connection.

description ConnectionDescription

The connection description.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A Task.

CustomizeInitialHelloCommand(BsonDocument)

Optionally customizes hello or legacy hello command.

public BsonDocument CustomizeInitialHelloCommand(BsonDocument helloCommand)

Parameters

helloCommand BsonDocument

Initial command.

Returns

BsonDocument

Optionally mutated command.