为什么重定向Uri需要是一个不存在的网站?

时间:2015-03-14 03:29:14

标签: windows-store-apps windows-phone-8.1 win-universal-app

我在运行Windows版通用应用时出现问题。我正在尝试使用OAuth将应用程序连接到Facebook。在Windows Phone方面,我可以将我的重定向Uri设置为自定义类似http://facebook.com的东西,并且它工作正常 - 结果返回正确的值。但是当我尝试在Windows Store端使用它时,它不起作用。基本上结果不会返回访问令牌或其他任何东西,它看起来像返回原始的开始Uri。此外,它实际上没有进入登录页面,它会跳过该部分。

此Uri在Windows应用商店中不起作用(但它适用于Windows Phone)

Uri endUri = new Uri("http://facebook.com", UriKind.Absolute);

此Uri适用于Windows应用商店

var redirectUri = WebAuthenticationBroker.GetCurrentApplicationCallbackUri().ToString();
Uri endUri = new Uri(redirectUri, UriKind.Absolute);

这是消耗Uri的代码。

#if WINDOWS_PHONE_APP
    WebAuthenticationBroker.AuthenticateAndContinue(startUri, endUri, null, WebAuthenticationOptions.None);
#endif

#if WINDOWS_APP
    WebAuthenticationResult result = await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None, startUri, endUri);
    await ParseAuthenticationResult(result);
#endif

有谁知道这是为什么?

0 个答案:

没有答案
相关问题