[#1277] Add test and auth function