我正在尝试实现 Facebook authentication sample , 当代码到达;
WebAuthenticationResult webAuthenticationResult = await WebAuthenticationBroker.AuthenticateAsync(
WebAuthenticationOptions.None,loginUrl);
我遇到如下异常;
Exception = {System.NotImplementedException: Not implemented
at Windows.Security.Authentication.Web.WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions options, Uri requestUri) at SonglyWindowsPhone.Views.Login.d__0.MoveNext() --- End ...
Message: The method or operation is not implemented.
有解决办法吗?
最佳答案
在 WinRT 中它是 similar situation to FilePickers - 你必须使用 AuthenticateAndContinue method .使用该方法后,您的应用将停用,并在完成身份验证后将被激活,此时您应该处理 app.xaml.cs 中的 OnActivated 事件:
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 class您还会找到示例链接。
和here at MSDN很好地解释了示例代码。
关于c# - WebAuthenticationResult - System.NotImplementedException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27476910/