.NET Web API 2 OWIN Bearer Token Authentication .NET Web API 2 OWIN Bearer Token Authentication asp.net asp.net

.NET Web API 2 OWIN Bearer Token Authentication


Resolved by setting header 'Authorization' with Bearer + token like:

$http.defaults.headers.common["Authorization"] = 'Bearer ' + token.accessToken;


You can configure it with your angular application module. So authorization token will be set as header for every http request.

var app = angular.module("app", ["ngRoute"]);app.run(function ($http) {     $http.defaults.headers.common.Authorization = 'Bearer ' + token.accessToken;});