Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-3239

Cannot authenticate with an AWS session token

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.11.5
    • Affects Version/s: None
    • Component/s: None
    • None

      When using MONGODB-AWS and authenticating with an AWS session token specified in the connection string (?authSource=$external&authMechanism=MONGODB-AWS&authMechanismProperties=AWS_SESSION_TOKEN:..., I receive the following authentication error:

      Unhandled exception. MongoDB.Driver.MongoAuthenticationException: Unable to authenticate using sasl protocol mechanism MONGODB-AWS.
       ---> MongoDB.Driver.MongoCommandException: Command saslContinue failed: Authentication failed..
         at MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1.ProcessReply(ConnectionId connectionId, ReplyMessage`1 reply)
         at MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1.Execute(IConnection connection, CancellationToken cancellationToken)
         at MongoDB.Driver.Core.Authentication.SaslAuthenticator.Authenticate(IConnection connection, ConnectionDescription description, CancellationToken cancellationToken)
         --- End of inner exception stack trace ---
         at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelper(CancellationToken cancellationToken)
         at MongoDB.Driver.Core.Connections.BinaryConnection.Open(CancellationToken cancellationToken)
         at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.PooledConnection.Open(CancellationToken cancellationToken)
         at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.AcquiredConnection.Open(CancellationToken cancellationToken)
         at MongoDB.Driver.Core.Servers.Server.GetChannel(CancellationToken cancellationToken)
         at MongoDB.Driver.Core.Bindings.ServerChannelSource.GetChannel(CancellationToken cancellationToken)
         at MongoDB.Driver.Core.Bindings.ChannelSourceHandle.GetChannel(CancellationToken cancellationToken)
         at MongoDB.Driver.Core.Operations.DropCollectionOperation.Execute(IWriteBinding binding, CancellationToken cancellationToken)
         at MongoDB.Driver.OperationExecutor.ExecuteWriteOperation[TResult](IWriteBinding binding, IWriteOperation`1 operation, CancellationToken cancellationToken)
         at MongoDB.Driver.MongoDatabaseImpl.ExecuteWriteOperation[T](IClientSessionHandle session, IWriteOperation`1 operation, CancellationToken cancellationToken)
         at MongoDB.Driver.MongoDatabaseImpl.DropCollection(IClientSessionHandle session, String name, CancellationToken cancellationToken)
         at MongoDB.Driver.MongoDatabaseImpl.<>c__DisplayClass29_0.<DropCollection>b__0(IClientSessionHandle session)
         at MongoDB.Driver.MongoDatabaseImpl.UsingImplicitSession(Action`1 func, CancellationToken cancellationToken)
         at MongoDB.Driver.MongoDatabaseImpl.DropCollection(String name, CancellationToken cancellationToken)
         at tour.Program.Main(String[] args) in /home/vagrant/dotnet/tour/csharp/Program.cs:line 20
      

      The same connection string works fine in the following:

      • mongo shell (4.4.1)
      • pymongo 3.11.0
      • Node.js driver 3.6.2

      This was tested using C# driver 2.11.2.

            Assignee:
            james.kovacs@mongodb.com James Kovacs
            Reporter:
            matthew.thompson@mongodb.com Matthew Thompson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: