Added the authenticate method.