I am unable to connect to AWS Keyspaces using .NET Core due to an authentication error:
AuthenticationException 'Provided username nick and/or password are incorrect')
I am not sure what values I should give to PlainTextAuthProvider
.
I have tried using:
How do I generate credentials for AWS Keyspaces?
My code, in case it is relevant:
open System
open Cassandra
[<EntryPoint>]
let main argv =
async {
let cluster =
Cluster.Builder()
.AddContactPoints("cassandra.eu-west-2.amazonaws.com")
.WithPort(9142)
.WithAuthProvider(PlainTextAuthProvider ("username", "password123"))
.WithSSL()
.Build()
use! session =
cluster.ConnectAsync ()
|> Async.AwaitTask
()
}
|> Async.RunSynchronously
0
The option is found in the IAM section.
Naviagate to:
This will show a pop-up where you can generate credentials.
Additionally, the code should specify a Keyspace:
open System
open Cassandra
[<EntryPoint>]
let main argv =
async {
let cluster =
Cluster.Builder()
.AddContactPoints("cassandra.eu-west-2.amazonaws.com")
.WithPort(9142)
.WithAuthProvider(PlainTextAuthProvider ("username", "password123"))
.WithSSL()
.Build()
use! session =
cluster.ConnectAsync "test_keyspace"
|> Async.AwaitTask
()
}
|> Async.RunSynchronously
0