if (identity != null) {
IAuthMethod authMethod = identity.getAuthMethod();
if (authMethod != null && authMethod.getType() == IAuthMethod.AuthMethodType.AUTH_METHOD_HTTP_MACRO) {
logger.info("Pre-authenticating using an HTTP macro");
IAuthMethodHttpMacro authMethodMacro = (IAuthMethodHttpMacro)authMethod;
IHttpMacroContext context = scan.getRequestEngine().createMacroContext();
context.setDict(identity.getDict());
IHttpMacroExecutor executor = scan.getRequestEngine().createMacroExecutor(authMethodMacro.getMacro(), context);
while (executor.hasNext()) {
IHttpResponse response;
int status;