public class KerberosHelper extends Object
| Constructor and Description |
|---|
KerberosHelper() |
| Modifier and Type | Method and Description |
|---|---|
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) |
public static Subject loginService(String serviceName) throws LoginException
serviceName - service name defined in jass.conf filenull is the authentication failedLoginException - if there is any error during the loginpublic static Subject loginService(String serviceName, String username, String password) throws LoginException
serviceName - service name defined in jass.conf fileusername - usernamepassword - passwordnull is the authentication failedLoginException - if there is any error during the loginpublic static GSSContext authenticateClient(Socket socket, Subject subject, String servicePrincipalName)
socket - The socket used for communicationsubject - The Kerberos service subjectservicePrincipalName - Service principal namepublic static String getSourcePrinciple(GSSContext context)
Copyright © 2014. All Rights Reserved.