Exception has occurred: CLR/MongoDB.Driver.MongoAuthenticationException
Exception thrown: ‘MongoDB.Driver.MongoAuthenticationException’ in System.Private.CoreLib.dll: ‘Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1.’
Inner exceptions found, see $exception in variables window for more details.
Innermost exception MongoDB.Driver.MongoCommandException : Command saslStart failed: bad auth : Authentication failed…
at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol1.ProcessResponse(ConnectionId connectionId, CommandMessage responseMessage) at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol1.d__20.MoveNext()
at MongoDB.Driver.Core.Authentication.SaslAuthenticator.d__10.MoveNext()
Service
var mongoClient = new MongoClient(settings.Value.ConnectionString);
var database = mongoClient.GetDatabase(settings.Value.DatabaseName);
_collection = database.GetCollection(settings.Value.CollectionName);
Program.ce
…
builder.Services.Configure(
builder.Configuration.GetSection(“MongoDBSettings”));