Handles 401 redirection from webapp