Authentication failed Atlas MongoDB

Hi! I build a mobile app in Unity and I can`t connect to cloud Atlas MongoDB. I downloaded all libraries(driver etc) and have this error:

MongoCommandException: Command saslContinue failed: bad auth : authentication failed.
MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1[TCommandResult].ProcessReply (MongoDB.Driver.Core.Connections.ConnectionId connectionId, MongoDB.Driver.Core.WireProtocol.Messages.ReplyMessage`1[TDocument] reply) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1[TCommandResult].ExecuteAsync (MongoDB.Driver.Core.Connections.IConnection connection, System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.Core.Authentication.SaslAuthenticator.AuthenticateAsync (MongoDB.Driver.Core.Connections.IConnection connection, MongoDB.Driver.Core.Connections.ConnectionDescription description, System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
Rethrow as MongoAuthenticationException: Unable to authenticate using sasl protocol mechanism SCRAM-SHA-1.
MongoDB.Driver.Core.Authentication.SaslAuthenticator.AuthenticateAsync (MongoDB.Driver.Core.Connections.IConnection connection, MongoDB.Driver.Core.Connections.ConnectionDescription description, System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.Core.Authentication.DefaultAuthenticator.AuthenticateAsync (MongoDB.Driver.Core.Connections.IConnection connection, MongoDB.Driver.Core.Connections.ConnectionDescription description, System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.Core.Authentication.AuthenticationHelper.AuthenticateAsync (MongoDB.Driver.Core.Connections.IConnection connection, MongoDB.Driver.Core.Connections.ConnectionDescription description, System.Collections.Generic.IReadOnlyList`1[T] authenticators, System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.Core.Connections.ConnectionInitializer.AuthenticateAsync (MongoDB.Driver.Core.Connections.IConnection connection, MongoDB.Driver.Core.Connections.ConnectionInitializerContext connectionInitializerContext, System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync (System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool+PooledConnection.OpenAsync (System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool+ConnectionCreator.CreateOpenedInternalAsync (System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool+ConnectionCreator.CreateOpenedOrReuseAsync (System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool+AcquireConnectionHelper.AcquireConnectionAsync (System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.AcquireConnectionAsync (System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.Core.Servers.Server.GetChannelAsync (System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.Core.Operations.RetryableWriteContext.InitializeAsync (System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.Core.Operations.RetryableWriteContext.CreateAsync (MongoDB.Driver.Core.Bindings.IWriteBinding binding, System.Boolean retryRequested, System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.Core.Operations.BulkMixedWriteOperation.ExecuteAsync (MongoDB.Driver.Core.Bindings.IWriteBinding binding, System.Threading.CancellationToken cancellationToken) (at <471405d605184dfebce84a25a9bd22a1>:0)
MongoDB.Driver.OperationExecutor.ExecuteWriteOperationAsync[TResult] (MongoDB.Driver.Core.Bindings.IWriteBinding binding, MongoDB.Driver.Core.Operations.IWriteOperation`1[TResult] operation, System.Threading.CancellationToken cancellationToken) (at <49b0ee9e114a4b9a88d894384d069a5a>:0)
MongoDB.Driver.MongoCollectionImpl`1[TDocument].ExecuteWriteOperationAsync[TResult] (MongoDB.Driver.IClientSessionHandle session, MongoDB.Driver.Core.Operations.IWriteOperation`1[TResult] operation, System.Threading.CancellationToken cancellationToken) (at <49b0ee9e114a4b9a88d894384d069a5a>:0)
MongoDB.Driver.MongoCollectionImpl`1[TDocument].BulkWriteAsync (MongoDB.Driver.IClientSessionHandle session, System.Collections.Generic.IEnumerable`1[T] requests, MongoDB.Driver.BulkWriteOptions options, System.Threading.CancellationToken cancellationToken) (at <49b0ee9e114a4b9a88d894384d069a5a>:0)
MongoDB.Driver.MongoCollectionImpl`1[TDocument].UsingImplicitSessionAsync[TResult] (System.Func`2[T,TResult] funcAsync, System.Threading.CancellationToken cancellationToken) (at <49b0ee9e114a4b9a88d894384d069a5a>:0)
MongoDB.Driver.MongoCollectionBase`1[TDocument].InsertOneAsync (TDocument document, MongoDB.Driver.InsertOneOptions options, System.Func`3[T1,T2,TResult] bulkWriteAsync) (at <49b0ee9e114a4b9a88d894384d069a5a>:0)
SignUp.SignUpFunction () (at Assets/Scripts/SignUp.cs:52)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <1f66344f2f89470293d8b67d71308c07>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <4014a86cbefb4944b2b6c9211c8fd2fc>:0)
UnityEngine.UnitySynchronizationContext.Exec () (at <4014a86cbefb4944b2b6c9211c8fd2fc>:0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <4014a86cbefb4944b2b6c9211c8fd2fc>:0)

Can you connect by shell with same id/pwd?
bad authentication means wrong combination of user & password

1 Like

I dont have shell. So I cant connect to cloud Atlas MongoDB without shell?
Ive added drivers to my Unity project and added drivers in NuGet. I am beginner in that and dont understand how to connect right to cloud mongo
Thanks for your answers!

Sorry for interrupting, I missed my correct password, so after I’ve created new user - I`ve connected to Atlas.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.