me.prettyprint.cassandra.connection.security
Class KerberosHelper
java.lang.Object
me.prettyprint.cassandra.connection.security.KerberosHelper
public class KerberosHelper
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KerberosHelper
public KerberosHelper()
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 fileusername - usernamepassword - 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 communicationsubject - The Kerberos service subjectservicePrincipalName - Service principal name
- Returns:
- context if authorized or null
getSourcePrinciple
public static String getSourcePrinciple(GSSContext context)
Copyright © 2012. All Rights Reserved.