Example code for Authorization with AngularJS