Implements the authentication function for admin