Apex authentication library