Changing auth. credentials without recreating Keyspace #469

heskech opened this Issue May 22, 2012 · 0 comments


None yet

1 participant


We have an implementation of IAuthenticator that authenticates clients against Cassandra. The client authenticates w/ Hector by passing a token in the credentials map (the map passed via HFactory.createKeyspace) and the token passed is only valid for so many hours. The client sees an AuthenticationException when the IAuthenticator implementation attempts to authenticate with the expired token.

final Map credentials = new ConcurrentHashMap();
credentials.put("token", getNewToken());
Keyspace keyspace = HFactory.createKeyspace("name", cluster, consistencyLevel, FailoverPolicy.ON_FAIL_TRY_ALL_AVAILABLE, credentials);

and then just before expiration, we would like to set the new token to the credentials map and have Hector/Cassandra use the new credentials for any new connections that are established...
credentials.put("token", getNewToken());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment