具有多个 STS 的 WIF

发布于 2024-10-27 13:00:57 字数 361 浏览 7 评论 0原文

对于图像质量很差表示歉意,但它显示了我想要实现的目标的场景,并想知道最好的解决方案是什么?

WIF Scenario

我有一个测试项目设置,使用 RP 到单个 STS - 其中工作正常,RP 被定向到STS 进行批准,然后发回令牌,很简单。

然而,我想要在我的 RP 上有一个下拉列表,您可以选择一种“模式”,并且根据此模式,您将重定向到其中一个 STS 提供商的授权。显然,我无法为此直接重定向到 STS,因此它必须是动态的,并且删除了 web.config 设置以实现 .NET 项目自动放置在那里的即时重定向。

有人可以对此给予指导吗?

Apologies for the image being of terrible quality, but it shows my scenario of what I'm trying to achieve and wondering what the best possible solution for this is?

WIF Scenario

I have a test project setup, using RP to a single STS - in which works fine, the RP gets directed to the STS for approval and then sends a token back, simple.

However, I want, say, a drop-down list on my RP that you choose a "mode" and based on this mode you will re-directed for authorisation to one of the STS providers. Obviously I can't re-direct straight to the STS for this and so it would have to be dynamic, and the web.config settings removed for instant re-directs that the .NET projects automatically put there.

Can anyone give guidance on this?

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

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

发布评论

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

评论(4

ぽ尐不点ル 2024-11-03 13:00:57

听起来您会受益于使用 Windows Azure 的 AppFrabric 访问控制服务 (ACS)。您希望避免在应用程序中放入代码来与每个 STS 提供商进行通信,ACS 旨在解决该问题。这个想法是,您可以根据需要为 ACS 配置任意数量的 STS 提供商,然后您的应用程序(使用 WIF)仅与 ACS 通信以执行授权。

在此处阅读有关它的更多信息(单击左侧的“访问控制”):http:// /www.microsoft.com/windowsazure/AppFabric/Overview/default.aspx

Sounds like you would benefit from using Windows Azure's AppFrabric Access Control Service (ACS). You want to avoid putting code in your application to communicate with every STS provider, and ACS is designed to address that problem. The idea is that you configure ACS with as many STS providers as you want, and then your application (using WIF) communicates solely with ACS to perform authorization.

Read more about it here (Click 'Access Control' on the left): http://www.microsoft.com/windowsazure/AppFabric/Overview/default.aspx

源来凯始玺欢你 2024-11-03 13:00:57

这就是你要做的。在global.asax中,添加此代码

void WSFederationAuthenticationModule_RedirectingToIdentityProvider(object sender, RedirectingToIdentityProviderEventArgs e)
{
    string whr = HttpContext.Current.Request.QueryString["whr"]; 
    if (!string.IsNullOrEmpty(whr))
    {
        //add your logic to determine the STS
        e.SignInRequestMessage.HomeRealm = @"http://path-to-STS";
    }
}

Here's what you do. In global.asax, add this code

void WSFederationAuthenticationModule_RedirectingToIdentityProvider(object sender, RedirectingToIdentityProviderEventArgs e)
{
    string whr = HttpContext.Current.Request.QueryString["whr"]; 
    if (!string.IsNullOrEmpty(whr))
    {
        //add your logic to determine the STS
        e.SignInRequestMessage.HomeRealm = @"http://path-to-STS";
    }
}
与他有关 2024-11-03 13:00:57

您还可以使用 ADFS v2.0 来完成此任务。与 ADFS 联合的任何其他 STS 将显示在“Home Realm Discovery”下拉列表中。

AppFabric ACS“本质上”是云中的 ADFS,没有什么可以阻止您联合 ADFS 和 ACS。

You could also use ADFS v2.0 to accomplish this. Any other STS federated with ADFS will appear in the "Home Realm Discovery" drop-down list.

AppFabric ACS is "essentially" ADFS in the cloud and there is nothing stopping you federating ADFS and ACS.

明天过后 2024-11-03 13:00:57

“RedirectingToIdentityProvider”覆盖也正是我要做的。

只需在此处发布此链接,您就可以在此处找到 IdentityFederationSamples 的集合(如果这有助于获得完整的解决方案)。有一个示例用于重定向到两个 STS 之一,还有另一个显示链接 STS。
http://www.michelelerouxbustamante.com/post/Cloud-Connections -Las-Vegas-Links.aspx

The "RedirectingToIdentityProvider" override is exactly what I would do as well.

Just posting this link here you can find a collection of IdentityFederationSamples here if that helps to have an entire solution. There is a sample for redirecting to one of two STS, there is another that shows chaining STS.
http://www.michelelerouxbustamante.com/post/Cloud-Connections-Las-Vegas-Links.aspx

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