我正在尝试在下面的链接中实现类似的东西。有人可以让我知道如何使用此令牌访问安全的第三方 API。
例如:我的 Web 应用位于http://localhosthost:8080/ui/ ,Web API 位于http://localhosthost:8080/rest-api/
我仍然没有看到请求附带任何令牌。
这是我的代码
app.config(['$routeProvider', '$httpProvider', 'adalAuthenticationServiceProvider', function ($routeProvider, $httpProvider,
adalAuthenticationServiceProvider) {
$routeProvider
.when("/", {templateUrl: "partials/package.html", requireADLogin: true,})
.when("/dashboard", {templateUrl: "partials/package.html", controller: "searchCtrl", requireADLogin: true,})
.when("/create", {templateUrl: "partials/upload.html", controller: "packageCtrl", requireADLogin: true,})
$routeProvider.otherwise({ redirectTo: "/home" });
var endpoints = {
// Map the location of a request to an API to a the identifier of the associated resource
"http://localhost:8081/rest-api/":
"http://localhost:8081/rest-api/",
};
adalAuthenticationServiceProvider.init(
{
tenant: 'common',
clientId: '',
extraQueryParameter: 'nux=1',
endpoints: endpoints
},
$httpProvider
);
}]);