Currently I have all ajax request that send Authentication token, but I created a service to export to excel, ajax doesn't support that and I am using location.href for the get request. Is there any way to add that token?
var getUrl = '/LandingView/ExportToExcel?excelHeader=' + excelHeader;
getUrl += '&companyId=' + $scope.options.companyId;
getUrl += '&startDate=' + $scope.options.startDate.toJSON();
getUrl += '&endDate=' + $scope.options.endDate.toJSON();
getUrl += '&page=' + $scope.options.page;
getUrl += '&stateFilter=' + $scope.options.stateFilter;
getUrl += '&rows=' + $scope.options.rows;
getUrl += '&alertFilter=' + $scope.options.alertFilter;
getUrl += '&mode=' + $scope.options.mode;
getUrl += '&showLanguages=' + $scope.options.showLanguages;
location.href = getUrl;
When I do this I need to include in the header the bearer token.
PS: I am using ASP.NET MVC in the backend and angularJS in the frontend.