generalize authentication