0

I am using Cassandra 3.7. I am using AuthProvider to for authentication. I have tried two methods:

AuthProvider authProvider = new PlainTextAuthProvider("abcd", "xyz");
Cluster cluster = Cluster.builder().addContactPoint(node).withAuthProvider(authProvider).build();
Session session = cluster.connect();

and

Cluster cluster = Cluster.builder().addContactPoint(node)..withCredentials("abcd", "xyz").build();
Session session = cluster.connect();

I am getting the following error:

Exception in thread "main" com.datastax.driver.core.exceptions.AuthenticationException: Authentication error on host /127.0.0.1:9042: Host /127.0.0.1:9042 requires authentication, but no authenticator found in Cluster configuration
    at com.datastax.driver.core.AuthProvider$1.newAuthenticator(AuthProvider.java:40)

What is causing the error and how do I fix it?

2
  • What you are doing should work. Can you include the code you are using to actually create a connection from the cluster. Commented Jul 27, 2016 at 13:56
  • @mikea I have added the code to the question. Commented Jul 27, 2016 at 14:10

1 Answer 1

1

Change value of authenticator and authorizer in cassandra.yaml:

authenticator: PasswordAuthenticator

authorizer: CassandraAuthorizer

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.