简体   繁体   English

面向服务的设置中基于WCF的联合安全性

[英]WCF-based federated security in a service-oriented setup

So i have the following scenario: 所以我有以下情况:

I have a WPF-application which includes a login-box. 我有一个WPF应用程序,其中包括一个登录框。 Users enter credentials, which is used to get a security token from a SecurityTokenService (STS). 用户输入凭据,该凭据用于从SecurityTokenService(STS)获取安全令牌。 This token is parsed to a backend web-service, and in this way the service authenticates the user. 该令牌被解析为后端Web服务,并以此方式对用户进行身份验证。 Since the binding between client and webservice is a wsFederationHttpBinding this happens pretty seemless. 由于客户端和Web服务之间的绑定是wsFederationHttpBinding,因此这种情况似乎很简单。

Now my problem is that I, from the webservice, needs to call another webservice which is also protected by federated security, expecting security-tokens from the same STS. 现在我的问题是,我需要从Web服务调用另一个受联合安全性保护的Web服务,并期望来自同一STS的安全令牌。

So essentially what I would like to do is to re-use the security token given from the client, in order to carry the users security-token to the second webservice. 因此,基本上我想做的是重复使用客户端提供的安全令牌,以将用户的安全令牌带到第二个Web服务。

I have found a way to create a WCF-channel to the second service, by providing a securitytoken, which is a common approach when caching security tokens. 我发现了一种通过提供安全令牌来创建通往第二个服务的WCF通道的方法,这是缓存安全令牌时的一种常用方法。 However I am having trouble finding a way of getting a hold on the security token, from the client, in the backend webservice. 但是,我很难在后端Web服务中找到一种从客户端获取安全令牌的方法。

Anyone with any experience in parsing a security-token in a multi-layered setup? 有在多层设置中解析安全令牌的经验吗?

You've just hit one of the most common issues with wsFederationHttpBinding. 您刚刚遇到了wsFederationHttpBinding的最常见问题之一。 There is a sample on MSDN for a durable issued token provider that should help. MSDN上有一个示例,可以为持久发行的令牌提供者提供帮助。

This sample shows how to build a custom token provider that caches tokens issued by a Security Token Service (STS). 此示例说明如何构建自定义令牌提供程序,以缓存由安全令牌服务(STS)发出的令牌。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM