LOG_KRB.debug( "PRE_AUTH required..." );
throw new KerberosException( ErrorType.KDC_ERR_PREAUTH_REQUIRED,
preparePreAuthenticationError( authContext.getEncryptionType(), config.getEncryptionTypes() ) );
}
PaEncTsEnc timestamp = null;
for ( PaData paData : preAuthData )
{
if ( paData.getPaDataType().equals( PaDataType.PA_ENC_TIMESTAMP ) )
{
EncryptedData dataValue = KerberosDecoder.decodeEncryptedData( paData.getPaDataValue() );
byte[] decryptedData = cipherTextHandler.decrypt( clientKey, dataValue,
KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
timestamp = KerberosDecoder.decodePaEncTsEnc( decryptedData );
}
}
if ( timestamp == null )
{
LOG_KRB.error( "No timestamp found" );
throw new KerberosException( ErrorType.KDC_ERR_PREAUTH_REQUIRED,
preparePreAuthenticationError( authContext.getEncryptionType(), config.getEncryptionTypes() ) );
}
if ( !timestamp.getPaTimestamp().isInClockSkew( config.getAllowableClockSkew() ) )
{
LOG_KRB.error( "Timestamp not in delay" );
throw new KerberosException( ErrorType.KDC_ERR_PREAUTH_FAILED );
}