handling multiple hosts for application auth