Web API / OWIN, SignalR & Authorization

后端 未结 3 706
误落风尘
误落风尘 2021-01-30 07:29

I am developing a prototype of an AngularJS, Web API, SignalR application as a potential starting point for a new project in VS 2013.

At this stage, I\'m pretty much usi

3条回答
  •  天命终不由人
    2021-01-30 07:49

    This how I solved it

    var authData = localStorageService.get('authorizationData');
    var token = authData.token;
     $.signalR.ajaxDefaults.headers = { Authorization: "Bearer " + token };
    

    No change on the server side code

    Hope it helps someone

提交回复
热议问题