Class MongoAWSAuthenticator
- Namespace
- MongoDB.Driver.Core.Authentication
- Assembly
- MongoDB.Driver.Core.dll
The Mongo AWS authenticator.
public class MongoAWSAuthenticator : SaslAuthenticator, IAuthenticator
- Inheritance
-
MongoAWSAuthenticator
- Implements
- Inherited Members
Constructors
MongoAWSAuthenticator(UsernamePasswordCredential, IEnumerable<KeyValuePair<string, string>>, ServerApi)
Initializes a new instance of the MongoAWSAuthenticator class.
public MongoAWSAuthenticator(UsernamePasswordCredential credential, IEnumerable<KeyValuePair<string, string>> properties, ServerApi serverApi)
Parameters
credential
UsernamePasswordCredentialThe credentials.
properties
IEnumerable<KeyValuePair<string, string>>The properties.
serverApi
ServerApiThe server API.
MongoAWSAuthenticator(string, IEnumerable<KeyValuePair<string, string>>, ServerApi)
Initializes a new instance of the MongoAWSAuthenticator class.
public MongoAWSAuthenticator(string username, IEnumerable<KeyValuePair<string, string>> properties, ServerApi serverApi)
Parameters
username
stringThe username.
properties
IEnumerable<KeyValuePair<string, string>>The properties.
serverApi
ServerApiThe server API.
Properties
DatabaseName
Gets the name of the database.
public override string DatabaseName { get; }
Property Value
- string
The name of the database.
MechanismName
Gets the name of the mechanism.
public static string MechanismName { get; }
Property Value
- string
The name of the mechanism.
Methods
Authenticate(IConnection, ConnectionDescription, CancellationToken)
Authenticates the connection.
public override 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 override Task AuthenticateAsync(IConnection connection, ConnectionDescription description, CancellationToken cancellationToken)
Parameters
connection
IConnectionThe connection.
description
ConnectionDescriptionThe connection description.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task
A Task.