Authentication with wrapper function