Refactored mgrast auth plug-in to work with current setup.