使用 ADFS 的条件身份验证

Conditional authentication with ADFS

我们有一个半public .Net 网站(托管在我们的服务器上)需要使用客户端的 ADFS 进行身份验证。

我们想重定向到 ADFS 身份验证站点 'when needed' 并重定向回我们站点中的一个页面。

我们的页面需要提取用户信息并建立会话。这在索赔中吗?我们如何获得这些信息?

重定向到 ADFS 身份验证站点时,我们希望传递将返回给我们的信息。

这可能吗?

非常感谢您提供的任何信息。我们到处找,好像找不到这个场景。

谢谢!

Our page would need to extract the user information and establish session. Is this in the claim? How do we get this information?

使用 AD FS 可以配置当您在 AD FS 服务器上配置依赖方时将哪种信息发送回您的应用程序。它被称为索赔发布政策:

您可以在此处配置规则以将 LDAP 属性的值作为声明发送:

现在,当您在应用程序中解码 SAMLResponse 时,您将看到一个用户配置文件,其中包含您为该特定中继方配置的属性。类似于(注意,在我上面的示例中,我将 ADFS 配置为发送 UPN 和组):

{
    "issuer": "http://fs.mysite.com/adfs/services/trust",
    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn": 
    "aduser@mysite.com",
    "http://schemas.xmlsoap.org/claims/Group": [
        "Group 1",
        "Group 2"
    ]
}

When redirecting to the ADFS authentication site we'd like to pass information that will be returned back to us.

Is this possible?

是的,您可以使用 RelayState。它是您传递给 AD FS 的参数,并与 SAMLResponse 一起返回给您的应用程序。