move authentication plugin stuff to portal.php and not in the Service class