当我将此令牌发送到WebApi中的控制器时,我得到401(未授权)信息为什么?我把这个令牌形式登录并且它是正确的。表单身份验证 - 令牌发送到控制器
$scope.expiresCookie = $cookies.get('expires');
$scope.issuedCookie = $cookies.get('issued');
$scope.access_tokenCookie = $cookies.get('access_token');
$scope.expires_inCookie = $cookies.get('expires_in');
$scope.token_typeCookie = $cookies.get('token_type');
$scope.user_nameCookie = $cookies.get('user_name');
$scope.addLink = "http://localhost:56305/api/ProductInsuranceCar";
$http({
method: "GET",
url: $scope.addLink,
headers: { 'Authorization': '' + $scope.token_typeCookie + ' ' + $scope.access_tokenCookie + '' },
headers: { 'Content-Type': 'application/json; charset=utf-8' }
}).then(function mySucces(response) {
$scope.test = response;
}, function myError(response) {
});
图片1
图片2
实施例正确的请求
当我使用高级REST客户端,我得到的信息,但在我的方法:/不工作...