auth functions for apps