Created authenticate method