WinRT中的AuthenticationService [英] AuthenticationService in WinRT
问题描述
您好。 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屋!