private static void verifySam( AuthenticationContext authContext ) throws KerberosException, InvalidTicketException
{
LOG.debug( "Verifying using SAM subsystem." );
KdcReq request = authContext.getRequest();
KdcServer config = authContext.getConfig();
PrincipalStoreEntry clientEntry = authContext.getClientEntry();
String clientName = clientEntry.getPrincipal().getName();
EncryptionKey clientKey = null;
if ( clientEntry.getSamType() != null )
{
if ( LOG.isDebugEnabled() )
{
LOG.debug(
"Entry for client principal {} has a valid SAM type. Invoking SAM subsystem for pre-authentication.",
clientName );
}
List<PaData> preAuthData = request.getPaData();
if ( preAuthData == null || preAuthData.size() == 0 )
{
throw new KerberosException( ErrorType.KDC_ERR_PREAUTH_REQUIRED, preparePreAuthenticationError(
request.getKdcReqBody().getEType(), config.getEncryptionTypes() ) );
}
try
{
for ( PaData paData : preAuthData )