- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
WebAuthenticationBroker 似乎无法处理到我的 ms-app://
的导航。 .只是抛出这个丑陋的错误,如下所示。
脚步
AuthenticateAsync()
,包括运行时获取的回调uri:WebAuthenticationBroker.GetCurrentApplicationCallbackUri()
"The specified protocol is unknown. (Exception from HRESULT: 0x800C000D)"
WebAuthenticationBroker.AuthenticateAsync()
的回调已收到(根据 Fiddler4 和事件查看器),但它抛出上述异常,好像它不知道如何解释
ms-app://
协议(protocol)。
private static string authorizeString =
"https://api.imgur.com/oauth2/authorize?client_id=---------&response_type=token";
private Uri startUri = new Uri(authorizeString);
public async void RequestToken() {
try {
var war = await WebAuthenticationBroker.AuthenticateAsync(
WebAuthenticationOptions.UseTitle
, startUri);
// Imgur knows my redirect URI, so I am not passing it through here
if (war.ResponseStatus == WebAuthenticationStatus.Success) {
var token = war.ResponseData;
}
} catch (Exception e) { throw e; }
}
AuthHost redirected to URL: <ms-app://s-1-15-2-504558873-2277781482-774653033-676865894-877042302-1411577334-1137525427/#access_token=------&expires_in=3600&token_type=bearer&refresh_token=------&account_username=------> from URL: <https://api.imgur.com/oauth2/authorize?client_id=------&response_type=token> with HttpStatusCode: 302.
AuthHost encountered a navigation error at URL: <https://api.imgur.com/oauth2/authorize?client_id=------&response_type=token> with StatusCode: 0x800C000D.
AuthHost encountered Meta Tag: mswebdialog-title with content: <Can't connect to the service>.
最佳答案
Afaik,即使您假设远程服务知道它,您也需要将结束 URL 传递给 AuthenticateAsync。
WebAuthenticationBroker 的工作方式如下:您指定一个“端点” URL,当它遇到以该 URL 开头的链接时,它会认为身份验证过程已完成,甚至不再尝试导航到该 URL。
因此,如果您将“foo://bar”指定为回调 URI,导航到“foo://bar”将完成身份验证,“foo://barbaz”也会完成身份验证,但不会“foo://baz”。
关于windows-8 - WebAuthenticationBroker 收到 OAuth2 回调时抛出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14742974/
我正在尝试制作一个在 Visual Studio Express 中连接到 Facebook 的应用程序。问题是在这段代码中: Windows.Security.Authentication.Web.
我正在构建一个 Windows 8 应用程序,我试图在应用程序启动时从 Google 数据 API 获取 token 。我构建了一个函数来执行此操作,它具有以下代码: string authCodeU
我刚刚尝试使用 WebAuthenticationBroker 连接到 Google,但我不喜欢系统生成对话框的可视化表示。有可能以某种方式改变它吗? 例如这是英文版的截图: 那些白色矩形真的很难看,
正在尝试使用 WebAuthenticationBroker.authenticateAndContinue 登录 facebook、twitter、google,当身份验证完成时,它会显示身份验证页
我的代码使用: WebAuthenticationResult WebAuthenticationResult = await WebAuthenticationBroker.Authenticate
我们在 Windows 10 UAP 应用程序中使用 WebAuthenticationBroker 连接到 OAuth 提供商,例如 Facebook、Flickr 和 Instagram。当操作系
我想将 WebAuthenticationBroker 用于带有 Pocket (http://getpocket.com) 的 oAuth。 Pocket API 在 http://getpocke
WebAuthenticationBroker 似乎无法处理到我的 ms-app:// 的导航。 .只是抛出这个丑陋的错误,如下所示。 脚步 调用 AuthenticateAsync() ,包括运行时
我正在使用 ACS 在 Windows 8 应用程序中进行身份验证。我观察到的正是我所期望的,因为 UI 显示了身份验证对话框,并且在成功输入我的 LiveID 凭据后,我返回到我的代码并显示成功状态
在 MainPage 的 OnNavigatedTo 事件中使用 WebAuthenticationBroker.AuthenticateAndContinue 时,出现以下异常: The remot
我正在使用此功能在 Facebook 上注销; WebAuthenticationResult webAuthenticationResult = await WebAuthenticationBro
我编写了一个基于 XAML 的 WinRT 应用程序,它通过 WebAuthenticationBroker.AuthenticateAsync 调用连接到foursquare。这是授权代码:
我正在使用 WebAuthenticationBroker.AuthenticateAsync() 方法。成功登录并授予对我的应用程序的访问权限后,它停留在 Dropbox 成功屏幕并且不会重定向到我
解决方案我的工作解决方案可以在答案或更新二中找到。 1) 现在确保,为了在本地主机上进行测试,您已经为本地主机端口上的入站设置了 Windows 防火墙。路由器上的端口转发(如果有的话)。 2) 然后
我在我的 Windows Phone 8.1 应用程序中执行 OAuth2 身份验证,我正在使用 WebAuthenticationBroker 和 WP 的 AuthenticateAndConti
我有一个已发布的 Xamarin.Forms 应用。该应用程序建议用户通过多个 OAuth 身份验证提供商(Google、Facebook、Microsoft、Yandex、Vkontakte、Mai
我是一名优秀的程序员,十分优秀!