Q:

How do I pass credentials to CassandraContext in Cassandraemon?

I am trying to use Cassandraemon to connect to a Cassandra instance in C# .NET. I cannot find any examples that allow you to specify credentials. My Cassandra instance is running on a server in AWS and I need to pass the username/password to connect. I have the following code:
var builder = new CassandraConnectionConfigBuilder
{
    Hosts = new[] { "cassandra.myinstance.com" },
    ConsistencyLevel = ConsistencyLevel.QUORUM,
    Timeout = TimeSpan.FromSeconds(100),
    Keyspace = "mykeyspace"
};

var config = new CassandraConnectionConfig(builder);
using (var context = new CassandraContext(config))
{
    Dictionary<string, string> credentials = new Dictionary<string, string>();
    credentials.Add("username", "password");
    context.Login(credentials);
}

When I run this, I get an Apache.Cassandra.AuthenticationExceptionerror on the context.Login(credentials) line. Am I getting the credentials dictionary wrong? Is the key not the username and the password not the value?

A:

I was using the credentials dictionary incorrectly. The dictionary needed keys for "username" and "password" with the correct values supplied. The follow is the correct code:
Dictionary<string, string> credentials = new Dictionary<string, string>();
credentials.Add("username", "yourusernamehere");
credentials.Add("password", "yourpasswordhere");
context.Login(credentials);

