2

Our chain goes:

ASP.NET app with WIF -> ADFS -> and maybe Azure ACS -> Facebook, Google etc.

We have users configured in AD with roles etc. These users can log-on to AD via ADFS and get their roles as per normal.

Optionally, they can log-on to one of the ACS providers and we have a use case that stores the ACS provider's unique ID in AD. If they use more than one provider, we have more than one mapping.

So we can map the user who log ins in via ACS to their "real" identity in AD.

What we are battling with is how to deliver the full set of claims to the users who login via ACS? Typically, you just get a name, email address and unique id.

Is there a claim rule that can search AD using the unique ID? This rule would have to establish which provider they used in order to use the correct unique ID in AD.

I guess we could query AD from the application but that means we have to add the code to all such applications?

We could probably do the conversion in a custom STS as well?

Any ideas, good links, articles etc?

4

2 回答 2

0

如果您的链条看起来像这样,您的场景可能会减少摩擦:

带有 WIF 的 ASP.NET 应用程序 -> Azure ACS ->(ADFS 或 Google 或 Facebook)

这是一个可行的选择吗?

当 ADFS 充当身份提供者而不是依赖方时,ACS 与 ADFS 的集成效果最好。此外,一方面 ADFS 很乐意与外部身份提供者联合以授予来自外部目录的用户访问权限,但我认为您不能让 ADFS 使用 ACS 颁发的令牌从其自己的本地 AD 目录中对用户进行身份验证。

于 2012-07-24T17:39:08.787 回答
0

您可以通过使用 ACS 声明提供者信任中的声明规则语言在 ADFS 中创建自定义规则来实现此目的(有关一些语言文档,请参阅此处此处)。

但是:我不确定您是否可以立即使用唯一 ID 搜索 AD,因为用于查询 AD 的参数类型未在声明规则语言中指定。规则模板使用 windows 帐户名称(布局:)DOMAIN\USERNAME进行搜索,因此我建议使用(自定义)属性存储而不是 AD 本身并将唯一 ID 映射到 windows 帐户名称。

假设您设置了属性存储,您可以创建自定义规则来设置 Windows 帐户名称声明,并使您能够使用 ADFS 的模板规则查询 AD。

自定义规则如下所示:

c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"]
 => add(store = "YourAttributeStore", 
  types = ("http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"),
  query = "{0}", param = c.Value);

要真正启用模板规则,您还需要在新生成的声明上设置颁发者,因为它们会检查它是否来自“AD AUTHORITY”。我不知道这是否是一种合法的方法,但我这样做是为了方便。这需要第二条规则,如下所示:

c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"]
 => issue(Issuer = "AD AUTHORITY", OriginalIssuer = "AD AUTHORITY",
  Type = "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname",
  Value = c.Value);

关于不同唯一 ID 提供者的区别,如何处理是您的选择。您可以为每个提供者创建一个自定义规则,让属性存储区做出区分或对您的属性存储区进行通用查询。声明规则语言的文档应该在这里为您提供帮助。


注意:这似乎是关于 ADFS/WIF/Claims based Identity 的书籍中经常避免的主题。这是我个人的解决方案,它可能不是最佳实践,这只是我想出的最方便的方法。如果有人知道这个特定主题的报道:请分享。

另请注意:ADFS 中的规则顺序很重要,在第一条规则中创建的声明在以下规则中可用,依此类推,这就是使这成为可能的原因。

编辑:一年前没有看到这个问题......希望这个答案对某人有所帮助。

于 2013-07-25T15:02:11.100 回答