UP-3621:  Refactor clearPass support for uPortal (apply this earlier fix to rel-4-0-patches as well)