usually you pass the auth token in the headers. Here is how I did it for one of my applications
angular.module('app', []).run(function($http) { $http.defaults.headers.common.Authorization = token; });
this will add the auth token to the default headers, so you donβt have to include it every time you make a request. If you want to include it in every call, then it will be something like this
$http({ method: 'GET', url: '/api/v1/asas?city='+$scope.cityname', header:{ 'Authorization': $scope.authtoken } }).success(function(data) { //success. }).error(function(error){ //failed. });
source share