kallaspriit / Cassandra-PHP-Client-Library

Cassandra PHP-based client library for managing and querying your Cassandra cluster
http://cassandra-php-client-library.com
103 stars 25 forks source link

Authentication does not work #30

Closed mondynus closed 11 years ago

mondynus commented 11 years ago

HI, i try to do this $cassandra->useKeyspace('keyspace','username','pass');

but i get InvalidRequestException. I found that there are not defined arrays keys ("username" and "password") of auth. request. After i fixed it, there is another exception in other part of library. I use Cassandra 1.2.4

Please help me solve this problem. Thanks so much

mondynus commented 11 years ago

I have solution. As i have written, there is mistake in "CassandraConnection" class in method useKeyspace. It is necessary to replace $request = new cassandra_AuthenticationRequest( array('credentials' => array($username,$password)) ); to $request = new cassandra_AuthenticationRequest( array('credentials' => array("username"=>$username,"password"=>$password)) ); Second exception was caused by bad set permisions to keyspace.

kallaspriit commented 11 years ago

Check it now, hope it works, no time to test myself. Open again if the issue persists :)