Added authenticate method.