gpt4 book ai didi

c# - WebAuthenticationResult - System.NotImplementedException

转载 作者:太空宇宙 更新时间:2023-11-03 15:47:34 32 4
gpt4 key购买 nike

我正在尝试实现 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/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com