UWP:WebAuthenticationBroker.AuthenticateAsync 不适用于保管箱?

UWP: WebAuthenticationBroker.AuthenticateAsync not working for dropbox?

Windows.Security.Authentication.Web 命名空间中的方法 WebAuthenticationBroker.AuthenticateAsync 似乎适用于 Google,但不适用于 Dropbox。对于 Dropbox,它显示“无法连接到服务”。

最快的重现方式(对于 UWP 和 Xamarin.UWP):

使用 var requestUri = new Uri("https://dropbox.com/oauth2/authorize?dummyQueryString"); 在与

的通话中

var response = await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None, requestUri, new Uri("dummycallbackUri:/"));

这导致:

调用它

var requestUri = new Uri("https://accounts.google.com/o/oauth2/auth?dummyQueryString");

导致显示 Google-content(一个 400 Bad Request,但这与虚拟查询字符串的预期一致)。

我测试了另一个与 OAuth 无关的随机 requestUri“https://whosebug.com/”,我得到:

最后一个示例可能会提供一些有关 WebAuthenticationBroker 工作原理的信息...当我使用最新版本的 Mozilla FireFox 作为我的默认浏览器时,它真的使用旧浏览器吗?

如何使用 Dropbox WebAuthenticationBroker.AuthenticateAsync

我无法解释为什么它显示的是错误而不是页面,但 Dropbox 并不正式支持在这样的 Web 视图中处理 OAuth 应用程序授权流程 (per docs),所以您无论如何应该通过系统浏览器发送。

这些 Web 视图有时会使用旧的浏览器引擎,而不是您安装的系统浏览器,因此它们更容易出现类似的兼容性问题。