Я пытаюсь установить связь с Azure Cosmos DB (MongoDB). Я использую mongodb.driver v2.8.1. Кто -нибудь может мне помочь? Большое спасибо. < /P>
var configurationSection = _configuration.GetSection("MongoDb");
MongoUrl mongoUrl = new MongoUrl(configurationSection["connectionString"]);
var databaseName = configurationSection["databaseName"];
var userName = mongoUrl.Username;
var password = mongoUrl.Password;
MongoClientSettings settings = new MongoClientSettings();
settings.Server = mongoUrl.Server;
settings.UseSsl = true;
settings.SslSettings = new SslSettings();
settings.SslSettings.EnabledSslProtocols = SslProtocols.Tls12;
settings.ConnectTimeout = TimeSpan.FromMinutes(1);
MongoIdentity identity = new MongoInternalIdentity(databaseName, userName);
MongoIdentityEvidence evidence = new PasswordEvidence(password);
settings.Credential = new MongoCredential("SCRAM-SHA-1", identity, evidence);
var mongoClient = new MongoClient(settings);
< /code>
Следующее исключение, добавленное, когда я пытаюсь получить данные из коллекции: < /p>
An unhandled exception occurred while processing the request.
MongoCommandException: Command saslContinue failed: SaslFailed. ConnectionId e6e7c4d7-4dcc-40c5-ad56-3307f3323a1a ActivityId: 9af84117-0000-0000-0000-000000000000.
MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol.ProcessReply(ConnectionId connectionId, ReplyMessage reply)
MongoAuthenticationException: Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1.
MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync(CancellationToken cancellationToken)
Stack Query Cookies Headers
MongoCommandException: Command saslContinue failed: SaslFailed. ConnectionId e6e7c4d7-4dcc-40c5-ad56-3307f3323a1a ActivityId: 9af84117-0000-0000-0000-000000000000.
MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol.ProcessReply(ConnectionId connectionId, ReplyMessage reply)
MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol.ExecuteAsync(IConnection connection, CancellationToken cancellationToken)
MongoDB.Driver.Core.Authentication.SaslAuthenticator.AuthenticateAsync(IConnection connection, ConnectionDescription description, CancellationToken cancellationToken)
Show raw exception details
MongoAuthenticationException: Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1.
MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync(CancellationToken cancellationToken)
MongoDB.Driver.Core.Servers.Server.GetChannelAsync(CancellationToken cancellationToken)
MongoDB.Driver.Core.Operations.FindOperation.ExecuteAsync(IReadBinding binding, CancellationToken cancellationToken)
MongoDB.Driver.OperationExecutor.ExecuteReadOperationAsync(IReadBinding binding, IReadOperation operation, CancellationToken cancellationToken)
MongoDB.Driver.MongoCollectionImpl.ExecuteReadOperationAsync(IClientSessionHandle session, IReadOperation operation, ReadPreference readPreference, CancellationToken cancellationToken)
MongoDB.Driver.MongoCollectionImpl.UsingImplicitSessionAsync(Func funcAsync, CancellationToken cancellationToken)
Babelfish.ME.MongoDb.Data.Services.AbstractDataService.FindAsync(BsonDocument filter, BsonDocument sort, int skip, int limit) in AbstractDataService.cs
Подробнее здесь: https://stackoverflow.com/questions/571 ... cram-sha-1
Mongodb.driver. Аутентификация через Scram-Sha-1 ⇐ C#
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как я могу добавить конфигурацию кафки Scram-Sha-512 с помощью Java API?
Anonymous » » в форуме JAVA - 0 Ответы
- 7 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Как получить список коллекции {Mongodb} в php, используя новый драйвер MongoDB\Driver\Manager
Anonymous » » в форуме Php - 0 Ответы
- 41 Просмотры
-
Последнее сообщение Anonymous
-