2

我正在尝试使用 Windows Phone 应用程序和实时连接。我的主页上有这个控件:

xmlns:live="clr-namespace:Microsoft.Live.Controls;assembly=Microsoft.Live.Controls"

...

<live:SignInButton ClientId="[my client id, which I registered earlier today]"
                   Scopes="wl.signin wl.basic"
                   Branding="Skydrive"
                   TextType="SignIn"
                   SessionChanged="SignInButton_SessionChanged" />

这是处理程序SessionChanged

private async void SignInButton_SessionChanged(object sender, LiveConnectSessionChangedEventArgs e)
{
    if (e.Error != null)
        System.Diagnostics.Debugger.Break();

    ...
}

我使用 Windows Phone 模拟器调试我的应用程序。当我单击登录按钮时,我得到了这个异常:

为输入参数“redirect_uri”提供的值无效。客户端应用程序必须标记为“移动”,或者该值必须是与注册的重定向 URI 匹配的绝对 URL。

我没有明确指定redirect_uri任何地方。为什么由于无效而登录失败redirect_uri

4

1 回答 1

8

您必须在 Windows 应用商店开发中心明确将您的应用标记为“移动”。

  1. 在浏览器中打开https://account.live.com/developers/applications/ 。
  2. 从“我的应用程序”中选择您的应用程序
  3. 点击“编辑设置”链接
  4. 单击“API 设置”链接。
  5. 将“移动或桌面客户端应用程序”设置为“是”。

API 设置页面截图

于 2014-03-01T23:02:39.177 回答