TTransport trans = inProt.getTransport();
if (!(trans instanceof TSaslServerTransport)) {
throw new TException("Unexpected non-SASL transport " + trans.getClass());
}
TSaslServerTransport saslTrans = (TSaslServerTransport)trans;
SaslServer saslServer = saslTrans.getSaslServer();
String authId = saslServer.getAuthorizationID();
authenticationMethod.set(AuthenticationMethod.KERBEROS);
LOG.debug("AUTH ID ======>" + authId);
String endUser = authId;
if(saslServer.getMechanismName().equals("DIGEST-MD5")) {
try {
TokenIdentifier tokenId = SaslRpcServer.getIdentifier(authId,
secretManager);
endUser = tokenId.getUser().getUserName();
authenticationMethod.set(AuthenticationMethod.TOKEN);