start generic auth function