Authentication middleware for Xavi server