【发布时间】:2011-07-25 00:53:07
【问题描述】:
我正在尝试从 LiveID API 检索一些信息,但出现错误:
The provided request does not include an access token. An access token is
required in order to request this resource.
代码比较简单;我包括库,使用从 WIF 获得的 nameidentifier 声明调用初始化程序,然后请求 me 路径。
从错误消息中我推测我未能提供访问令牌...但是自从我成功检索到声明后,我的应用程序不会已经有这个吗?
这是我的代码:
<script src="https://js.live.net/v5.0/wl.js" type="text/javascript"></script>
<script type="text/javascript">
WL.init({ client_id: 'O0UpnnhoiFljBJAtTxhVliu4qtbUWoEVxdgfK7SBR+M=' });
WL.api({ path: "me", method: "GET" }, function (response) {
// response.error.message
});
* 更新 *
我想到也许我需要登录系统,所以我现在有:
WL.init({ client_id: 'O0UpnnhoiFljBJAtTxhVliu4qtbUWoEVxdgfK7SBR+M=' });
WL.login();
WL.api({ path: "me", method: "GET" }, function (response) {
但同样的错误...
【问题讨论】:
标签: claims-based-identity wif windows-live-id liveid