com.datastax.driver.auth
Class PrivilegedSaslClient

java.lang.Object
  extended by com.datastax.driver.auth.PrivilegedSaslClient

public class PrivilegedSaslClient
extends Object

Wrapper around SaslClient, which performs necessary parts of the authentication protocol as PrivilegedActions with the assumed identity of the Subject supplied in the constructor.


Field Summary
static Map<String,String> DEFAULT_PROPERTIES
           
 
Constructor Summary
PrivilegedSaslClient(Subject clientIdentity, String[] mechanisms, String authzId, String protocol, String hostname, Map<String,String> properties, CallbackHandler callbackHandler)
           
 
Method Summary
 byte[] evaluateChallenge(byte[] challenge)
          Respond to server's SASL token
 byte[] getInitialResponse()
          Generate an initial token to start the SASL handshake with server.
 boolean isComplete()
          Is the SASL negotiation with the server complete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PROPERTIES

public static final Map<String,String> DEFAULT_PROPERTIES
Constructor Detail

PrivilegedSaslClient

public PrivilegedSaslClient(Subject clientIdentity,
                            String[] mechanisms,
                            String authzId,
                            String protocol,
                            String hostname,
                            Map<String,String> properties,
                            CallbackHandler callbackHandler)
Method Detail

getInitialResponse

public byte[] getInitialResponse()
Generate an initial token to start the SASL handshake with server.

Returns:
SaslTokenRequestMessage message to be sent to server.
Throws:
IOException

evaluateChallenge

public byte[] evaluateChallenge(byte[] challenge)
Respond to server's SASL token

Parameters:
challenge - contains server's SASL token
Returns:
client's response SASL token, which will be null if authentication is complete

isComplete

public boolean isComplete()
Is the SASL negotiation with the server complete

Returns:
true iff SASL authentication has successfully completed


Copyright © 2014. All rights reserved.