A simple authentication API for AngularJS