WCF RESTful 服务的基于声明的身份验证

发布于 2024-08-28 18:07:11 字数 1211 浏览 1 评论 0原文

我一直在研究各种示例,尝试拼凑出一个针对 ASP.Net Web 服务和 WCF RESTful Web 服务的基于 SAML 令牌的身份验证的解决方案...我引用的一些示例:

我一直在努力克服每个障碍,而且我已经很接近了,我可以尝到它的味道。让我困惑的最新块是这样的:

如果我使用常规的 WebServiceHostFactory,则会应用自定义授权策略,并且 Thread.CurrentPrincipal 最终会采用我的 HttpModule 为 HttpContext.Current.User 设置的值...但是...如果我使用 WebServiceHost2Factory(即来自 REST Starter Kit)来获取自动帮助端点等...,然后不应用身份验证策略,并且 Thread.CurrentPrincipal 最终成为 RoleProviderPrincipal 的实例,与ClaimsPrincipal 我在 HttpModule 中设置..:-(

有什么想法、想法如何让 WebServiceHost2Factory 与自定义/覆盖的主体很好地配合吗?

谢谢,

Tyler

I've been working through various samples to try and piece together a solution for SAML token-based authentication for ASP.Net web services and WCF RESTful web services... some of the samples I've been referencing:

I've been battling my way through each roadblock, and I'm so close I can taste it. The latest block that's got me is this:

If I use the regular WebServiceHostFactory, the custom authorization policies are applied and Thread.CurrentPrincipal ends up taking the value that my HttpModule set for HttpContext.Current.User... but... if I use the WebServiceHost2Factory (i.e. from the REST Starter Kit) to gain the auto help endpoint, etc..., then the auth policies aren't applied, and the Thread.CurrentPrincipal ends up being an instance of RoleProviderPrincipal in no way related to the ClaimsPrincipal I set in the HttpModule.. :-(

Any thoughts, ideas how to get the WebServiceHost2Factory to play nice with the custom / overridden principal?

Thanks,

Tyler

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

面如桃花 2024-09-04 18:07:13

似乎这个问题在 MSDN/WCF 论坛的交叉帖子中得到了回答:
http://social.msdn.microsoft .com/Forums/en/wcf/thread/28fdaa9f-b75a-4ad6-a5f7-7e5af5dc909b

--larsw

Seems like the question was answered in the cross post in the MSDN/WCF forum:
http://social.msdn.microsoft.com/Forums/en/wcf/thread/28fdaa9f-b75a-4ad6-a5f7-7e5af5dc909b

--larsw

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文