com.datastax.driver.auth
Class DseAuthProvider

java.lang.Object
  extended by com.datastax.driver.auth.DseAuthProvider
All Implemented Interfaces:
com.datastax.driver.core.AuthProvider

public class DseAuthProvider
extends Object
implements com.datastax.driver.core.AuthProvider

AuthProvider which supplies authenticator instances for clients to connect t DSE clusters secured with Kerberos The SASL protocol name defaults to "dse"; should you need to change that it can be overridden using the dse.sasl.protocol system property.

Keytab and ticket cache settings are specified using a standard JAAS configuration file. The location of the file can be set using the java.security.auth.login.config system property or by adding a login.config.url.n entry in the java.security properties file.

See http://docs.oracle.com/javase/1.4.2/docs/guide/security/jaas/tutorials/LoginConfigFile.html for further details on the Login configuration file and http://docs.oracle.com/javase/6/docs/technotes/guides/security/jaas/tutorials/GeneralAcnOnly.html for more on JAAS in general.

Authentication using ticket cache

Run kinit to obtain a ticket and populate the cache before connecting. JAAS config:
 DseClient {
   com.sun.security.auth.module.Krb5LoginModule required
     useTicketCache=true
     renewTGT=true;
 };
 

Authentication using a keytab file

To enable authentication using a keytab file, specify its location on disk. If your keytab contains more than one principal key, you should also specify which one to select.

 DseClient {
     com.sun.security.auth.module.Krb5LoginModule required
       useKeyTab=true
       keyTab="/path/to/file.keytab"
       principal="user@MYDOMAIN.COM";
 };
 
To connect to clusters using internal authentication, use the standard method for setting credentials. eg:
 Cluster cluster = Cluster.builder()
                          .addContactPoint(hostname)
                          .withCredentials("username", "password")
                          .build();
 


Field Summary
 
Fields inherited from interface com.datastax.driver.core.AuthProvider
NONE
 
Constructor Summary
DseAuthProvider()
           
 
Method Summary
 com.datastax.driver.core.Authenticator newAuthenticator(InetAddress host)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DseAuthProvider

public DseAuthProvider()
Method Detail

newAuthenticator

public com.datastax.driver.core.Authenticator newAuthenticator(InetAddress host)
                                                        throws com.datastax.driver.core.exceptions.AuthenticationException
Specified by:
newAuthenticator in interface com.datastax.driver.core.AuthProvider
Throws:
com.datastax.driver.core.exceptions.AuthenticationException


Copyright © 2014. All rights reserved.