me.prettyprint.cassandra.connection.security
Class KerberosHelper

java.lang.Object
  extended by me.prettyprint.cassandra.connection.security.KerberosHelper

public class KerberosHelper
extends Object


Constructor Summary
KerberosHelper()
           
 
Method Summary
static GSSContext authenticateClient(Socket socket, Subject subject, String servicePrincipalName)
          Authenticate client to use this service and return secure context
static String getSourcePrinciple(GSSContext context)
           
static Subject loginService(String serviceName)
          Log in using the service name for jaas.conf file and .keytab instead of specifying username and password
static Subject loginService(String serviceName, String username, String password)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KerberosHelper

public KerberosHelper()
Method Detail

loginService

public static Subject loginService(String serviceName)
                            throws LoginException
Log in using the service name for jaas.conf file and .keytab instead of specifying username and password

Parameters:
serviceName - service name defined in jass.conf file
Returns:
the authenticated Subject or null is the authentication failed
Throws:
LoginException - if there is any error during the login

loginService

public static Subject loginService(String serviceName,
                                   String username,
                                   String password)
                            throws LoginException
Parameters:
serviceName - service name defined in jass.conf file
username - username
password - password
Returns:
the authenticated Subject or null is the authentication failed
Throws:
LoginException - if there is any error during the login

authenticateClient

public static GSSContext authenticateClient(Socket socket,
                                            Subject subject,
                                            String servicePrincipalName)
Authenticate client to use this service and return secure context

Parameters:
socket - The socket used for communication
subject - The Kerberos service subject
servicePrincipalName - Service principal name
Returns:
context if authorized or null

getSourcePrinciple

public static String getSourcePrinciple(GSSContext context)


Copyright © 2012. All Rights Reserved.