在SSO模式下使用WebAuthenticationBroker [英] Using the WebAuthenticationBroker in SSO mode

查看:65
本文介绍了在SSO模式下使用WebAuthenticationBroker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用自定义SSO服务进行身份验证的javascript开发Windows应用商店应用。  登录/身份验证过程会删除在此服务的后续请求中使用的会话cookie。


我正在尝试在"SSO模式"中使用WebAuthenticationBroker。使用此方法:


 WebAuthenticationBroker.authenticateAsync(WebAuthenticationOptions.none,startURI)

如果使用SSO模式,文档似乎表明在WebAuthenticationBroker上下文中丢弃的任何cookie都将与'app context'共享。    使用代理工具,我可以在用户登录后在
的WAB上下文中查看HTTP响应中的set-cookie标头,但是在WebAuthenticationBroker关闭后(通过检测'ms-app://的重定向) ...'),应用程序上下文中的后续http请求(使用XHR)缺少SSO cookie。


1)我是否尝试以正确的方式使用WebAuthenticationBroker?


2)如果是这样,有什么方法可以诊断出现了什么问题吗? (即。以任何方式查看应用程序使用的当前cookie?)

解决方案

使用WebAuthenticationBroker类连接自定义SSO服务,你需要检查您的服务以支持OAuth,例如Facebook,Flickr,Google和Twitter。代码示例向您展示如何。

https://code.msdn.microsoft.com/windowsapps/Web-认证-d0485122


I'm developing a Windows Store app in javascript that is trying to authenticate with a custom SSO service.  The login/authentication process drops a session cookie that is used on subsequent requests to this service.

I'm trying to use the WebAuthenticationBroker in "SSO mode" using this method:

WebAuthenticationBroker.authenticateAsync(WebAuthenticationOptions.none, startURI)

The docs seem to indicate that any cookies dropped while in the context of the WebAuthenticationBroker will be shared with the 'app context' if SSO mode is used.    Using proxy tools, I can see the set-cookie header on the HTTP response within the WAB context after the user logs in, but after the WebAuthenticationBroker closes (by detecting the redirect of 'ms-app://...'),  subsequent http requests within the app context (using XHR) are missing the SSO cookie.

1) Am I trying to use the WebAuthenticationBroker in the correct fashion?

2) If so, is there any way to diagnose what is going wrong? (ie. any way to view the current cookies used by the app?)

解决方案

Use WebAuthenticationBroker class to connect custom SSO service, you need to check your service to support OAuth, such as Facebook, Flickr, Google and Twitter. A code sample shows you how. https://code.msdn.microsoft.com/windowsapps/Web-Authentication-d0485122.


这篇关于在SSO模式下使用WebAuthenticationBroker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆