Connect middleware for node CAS client