Forum: Building VoltDB Clients

Post: Hashed Password with ClientConfig

Hashed Password with ClientConfig
nshi
Oct 27, 2012
Hi RJ,

Only clear text password is allowed when you create the Java ClientConfig object. The password will be hashed on ClientFactory.createClient() and only the hashed password is sent over the wire to the server.

Ning
Hashed Password with ClientConfig
tequilamaya
Oct 28, 2012
Hi folks,

Have implemented security on my Volt DB and have no problems accessing the volt JSON interface using hashed passwords or clear text passwords. That works fine.

However, unless I'm doing something silly I can't for the life of me get a hashed password to work when using Java code like the following:

org.voltdb.client.Client client = null;
ClientConfig config = null;
try {
config = new ClientConfig("admin","C95EE47689A0AAEC70C3EB950244657722C69B1F");
client = ClientFactory.createClient(config);
client.createConnection("myserver.xyz.net");
} catch (java.io.IOException e) {
e.printStackTrace();
System.exit(-1);
}

password - tech
hashed password - C95EE47689A0AAEC70C3EB950244657722C69B1F

I can get code like the above to work when using a clear text password. I get the following error when substituting the hashed equivalent:

java.io.IOException: Authentication rejected
at org.voltdb.client.ConnectionUtil.getAuthenticatedConnection(ConnectionUtil.java:247)
at org.voltdb.client.ConnectionUtil.getAuthenticatedConnection(ConnectionUtil.java:143)
at org.voltdb.client.ConnectionUtil.getAuthenticatedConnection(ConnectionUtil.java:118)
at org.voltdb.client.Distributer.createConnectionWithHashedCredentials(Distributer.java:455)
at org.voltdb.client.ClientImpl.createConnectionWithHashedCredentials(ClientImpl.java:161)
at org.voltdb.client.ClientImpl.createConnection(ClientImpl.java:523)
at testapp.utils.db.DBManager.(DBManager.java:35)
at testharness.StoredProcHashed_TEST.main(StoredProcHashed_TEST.java:34)

Can someone point me in the right direction?

Cheers
RJ
Hashed Password with ClientConfig
tequilamaya
Oct 29, 2012
Thanks Ning,

That's great - at least its being hashed over the wire by default.

Regards
RJ