AuthType reportAuth = null;
Iterator<IAuthExecutor> it = executors.iterator();
while(!isAllowed && it.hasNext()) {
IAuthExecutor executor = it.next();
AuthReport authReport = executor.checkAllowed(exchange, api);
isAllowed = authReport.isAllowed();
if (isAllowed) {
authIdentity = authReport.getAuthIdentity();
report = authReport;
} else {
if (report == null) {
report = authReport;
reportAuth = executor.getType();
} else {
if (report.compareTo(authReport) > 0) {
report = authReport;
reportAuth = executor.getType();
}
}
}
// The last executor
authType = executor.getType();
}
if (isAllowed) {
if(logger.isDebugEnabled()) {
logger.debug("Request allowed to use this Api");