Using JAAS with Jolokia + Cassandra

classic Classic list List threaded Threaded
1 message Options
srand06 srand06
Reply | Threaded
Open this post in threaded view
|

Using JAAS with Jolokia + Cassandra

This post was updated on .
Hi,

I'm trying to use JAAS to connect to Cassandra's JMX through Jolokia. JMX uses  JAAS to authenticate using Cassandra's internal Authenticator and Authorizer :

-javaagent:/usr/local/share/jolokia-agent.jar=host=0.0.0.0,executor=fixed,authMode=jaas
-Dcom.sun.management.jmxremote.authenticate=true,
-Dcassandra.jmx.remote.login.config=CassandraLogin,
-Djava.security.auth.login.config=/etc/cassandra/cassandra-jaas.config,
-Dcassandra.jmx.authorizer=org.apache.cassandra.auth.jmx.AuthorizationProxy,
-Dcom.sun.management.jmxremote,
-Dcom.sun.management.jmxremote.ssl=false,
-Dcom.sun.management.jmxremote.local.only=false,
-Dcassandra.jmx.remote.port=7199,
-Dcom.sun.management.jmxremote.rmi.port=7199,
-Djava.rmi.server.hostname= 2a1d064ce844,

You can see that java.security.auth.login.config is already  set to a file filled  with

$cat /etc/cassandra/cassandra-jaas.config
// Delegates authentication to Cassandra's configured IAuthenticator
CassandraLogin {
  org.apache.cassandra.auth.CassandraLoginModule REQUIRED;
};

However, everytime I try to connect to Jolokia I get a 401 Unauthorized

echo '{"mbean": "org.apache.cassandra.db:type=StorageService", "attribute": "OperationMode", "type": "read"}' | http -a cassandra:cassandra POST http://localhost:8778/jolokia/

Can  you tell me  what I need to do to make it work ? What  have I  forgot ?

Thank you