Rest Authentication for AngularJS