CCAuth functions and tests