WinRT中的AuthenticationService [英] AuthenticationService in WinRT

查看:54
本文介绍了WinRT中的AuthenticationService的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。 WCF AuthenticationService在WinRT应用程序中不可用,因为AuthenticationService使用cookie来管理身份验证,而WinRT应用程序不在HttpContext中运行。因此,即使客户端进行身份验证,
HttpContext.Current.User.Identity.IsAuthenticated 也始终等于false。


是否有任何等效的方法来提供用户名/密码验证用于保护WinRT客户端使用的Web服务?


谢谢。

解决方案

您是否看到了HttpClient示例? 
http://code.msdn.microsoft.com/windowsapps/HttpClient-sample-55700664


请查看HttpClientHandler类,该类公开凭据:
http://msdn.microsoft.com/en-us/library/system.net.http.httpclienthandler(v=vs.110




另见
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/78c981f4-9dc6-4785-a8ff-f8e90d7c93b7




Hi. The WCF AuthenticationService is not usable from WinRT apps because AuthenticationService uses cookies to manage authentication, and WinRT apps do not run in an HttpContext. Therefore HttpContext.Current.User.Identity.IsAuthenticated always equals to false even when the client authenticates.

Is there any equivalent means to provide username/password authentication for securing a web service to be consumed by a WinRT client?

Thanks.

解决方案

Did you see the HttpClient sample?  http://code.msdn.microsoft.com/windowsapps/HttpClient-sample-55700664
Please look up the HttpClientHandler class, which exposes credentials: http://msdn.microsoft.com/en-us/library/system.net.http.httpclienthandler(v=vs.110)

Also see http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/78c981f4-9dc6-4785-a8ff-f8e90d7c93b7


这篇关于WinRT中的AuthenticationService的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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