add AuthMiddleware class; urlopen may not work properly on RHEL 5.4 x86_64