我正在尝试实现Facebook身份验证示例,当代码到达;
WebAuthenticationResult webAuthenticationResult = await WebAuthenticationBroker.AuthenticateAsync(
WebAuthenticationOptions.None,loginUrl);我得到的例外如下;
异常= {System.NotImplementedException:未实现 在Windows.Security.Authentication.Web.WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions options,Uri requestUri) at SonglyWindowsPhone.Views.Login.d__0.MoveNext() -结束. 消息:方法或操作未实现。
有什么解决办法吗?
发布于 2014-12-15 06:54:35
在WinRT中它是类似的情况 --你必须使用AuthenticateAndContinue法。一旦您使用了该方法,您的应用程序就会被停用,在完成身份验证之后,它将被激活,此时您应该在app.xaml.cs中处理app.xaml.cs事件:
protected async override void OnActivated(IActivatedEventArgs args)
{
base.OnActivated(args);
var continuationEventArgs = args as IContinuationActivatedEventArgs;
if (continuationEventArgs != null)
{
switch (continuationEventArgs.Kind)
{
case ActivationKind.WebAuthenticationBrokerContinuation:
ValueSet data = continuationEventArgs.ContinuationData;
// continue web authentication
break;
// rest of code在WebAuthenticationBroker类中,您还可以找到一个指向示例的链接。
在MSDN是一个很好的示例代码解释。
https://stackoverflow.com/questions/27476910
复制相似问题