StoreFront

SAML 身份验证

SAML(安全断言标记语言)是身份和身份验证产品使用的开放标准。使用 SAML,您可以配置 StoreFront 以将用户重定向到外部身份提供程序进行身份验证。

注意

为内部访问配置 StoreFront 的 SAML 身份验证。对于外部访问,请使用 SAML 身份验证配置 Citrix Gateway,然后配置 StoreFront 的 Gateway 直通身份验证。

StoreFront 需要符合 SAML 2.0 的身份提供程序 (IdP),例如:

  • 使用 SAML 绑定(而非 WS-Federation 绑定)的 Microsoft AD 联合身份验证服务。有关详细信息,请参阅 CTX220638
  • 思杰网关(配置为身份提供程序 (IdP))
  • Microsoft Entra ID 身份验证服务。有关详细信息,请参阅 CTX237490

SAML 断言必须包含一个 <saml:NameID> 元素,其中填充了用户的用户主体名称 (UPN)。StoreFront 在 Active Directory 中查找此 UPN。StoreFront 不支持其他目录中的用户。使用 Entra ID 时,用户必须具有混合身份。

要为应用商店启用或禁用 SAML 身份验证,请在 身份验证方法 窗口中选择 SAML 身份验证。默认情况下,为应用商店启用 SAML 身份验证会为该应用商店的所有网站启用它。您可以在 身份验证方法 选项卡上独立禁用或启用每个网站的 SAML 身份验证。

StoreFront™ 的 SAML 身份验证协议端点配置和管理

要配置 SAML,您的身份提供程序可能需要以下端点:

  • 实体 ID 的 URL。这是应用商店身份验证服务的路径,通常为 https://[storefront host]/Citrix/[StoreName]Auth
  • 断言使用者服务的 URL,通常为 https://[storefront host]/Citrix/[StoreName]Auth/SamlForms/AssertionConsumerService
  • 元数据服务,通常为 https://[storefront host]/Citrix/[StoreName]Auth/SamlForms/ServiceProvider/Metadata

此外还有一个测试端点,通常是 https://[storefront host]/Citrix/[StoreName]Auth/SamlTest

您可以使用以下 PowerShell 脚本列出指定商店的端点。

# Change this value for your Store
$storeVirtualPath = "/Citrix/Store"

$auth = Get-STFAuthenticationService -Store (Get-STFStoreService -VirtualPath $storeVirtualPath)
$spId = $auth.AuthenticationSettings["samlForms"].SamlSettings.ServiceProvider.Uri.AbsoluteUri
$acs = New-Object System.Uri $auth.Routing.HostbaseUrl, ($auth.VirtualPath + "/SamlForms/AssertionConsumerService")
$md = New-Object System.Uri $auth.Routing.HostbaseUrl, ($auth.VirtualPath + "/SamlForms/ServiceProvider/Metadata")
$samlTest = New-Object System.Uri $auth.Routing.HostbaseUrl, ($auth.VirtualPath + "/SamlTest")
Write-Host "SAML Service Provider information:
Entity ID: $spId
Assertion Consumer Service: $acs
Metadata: $md
Test Page: $samlTest"
<!--NeedCopy-->

以下是输出示例:

SAML Service Provider information:
Entity ID: https://storefront.example.com/Citrix/StoreAuth
Assertion Consumer Service: https://storefront.example.com/Citrix/StoreAuth/SamlForms/AssertionConsumerService
Metadata: https://storefront.example.com/Citrix/StoreAuth/SamlForms/ServiceProvider/Metadata
Test Page: https://storefront.example.com/Citrix/StoreAuth/SamlTest
<!--NeedCopy-->

使用元数据交换进行配置

为简化配置,您可以在身份提供程序和(本例中为 StoreFront 的)服务提供程序之间交换元数据(标识符、证书、端点及其他配置)。

如果您的身份提供程序支持元数据导入,则可以将其指向 StoreFront 元数据端点注意:这必须通过 HTTPS 完成。

若要使用身份提供程序提供的元数据来配置 StoreFront,您需要使用 Update-STFSamlIdPFromMetadata cmdlet。例如,您可以按照以下方式进行操作:

Get-Module "Citrix.StoreFront*" -ListAvailable | Import-Module

# Remember to change this with the virtual path of your Store.
$StoreVirtualPath = "/Citrix/Store"

$store = Get-STFStoreService -VirtualPath $StoreVirtualPath
$auth = Get-STFAuthenticationService -StoreService $store

# To read the metadata directly from the Identity Provider, use the following:
# Note again this is only allowed for https endpoints
Update-STFSamlIdPFromMetadata -AuthenticationService $auth -Url https://example.com/FederationMetadata/2007-06/FederationMetadata.xml

# If the metadata has already been download, use the following:
# Note: Ensure that the file is encoded as UTF-8
Update-STFSamlIdPFromMetadata -AuthenticationService $auth -FilePath "C:\Users\exampleusername\Downloads\FederationMetadata.xml"
<!--NeedCopy-->

配置身份提供程序

  1. 单击 SAML 身份验证行中的设置下拉菜单,然后单击身份提供程序

    SAML 设置菜单的屏幕截图

    身份提供程序窗口的屏幕截图

  2. 选择 SAML 绑定提交重定向

  3. 输入身份提供程序的地址

  4. 导入用于签署 SAML 令牌的证书。

  5. OK 保存更改。

配置服务提供商

  1. 点击 SAML 身份验证 行中的设置下拉菜单,然后点击 服务提供商

    身份提供商窗口的屏幕截图(/zh-cn/storefront/2203-ltsr/media/configure-authentication/saml-service-provider.png)

  2. (可选)选择一个 导出签名证书,用于向身份提供商签名消息。

  3. (可选)选择一个 导出加密证书,用于解密从身份提供商接收到的消息。

  4. 服务提供商标识符 已预先填充为商店的身份验证服务。

  5. 确定 以保存更改。

PowerShell 软件开发工具包

使用 PowerShell 开发工具包:

  • 要导入签名证书,请调用 (https://developer-docs.citrix.com/zh-cn/storefront-powershell-sdk/2203/import-stfsamlsigningcertificate) 命令。

  • To import an encryption certificate call cmdlet Import-STFSamlEncryptionCertificate.

测试

要测试 SAML 集成:

  1. 请访问 SAML 测试页面,详细信息请参阅 StoreFront SAML 端点
  2. 这会将您重定向到身份提供商。输入您的凭据。
  3. 您将被重定向回测试页面,该页面显示身份声明和断言。

配置 交付控制器™ 以信任 StoreFront

使用 SAML 身份验证时,StoreFront 无法访问用户凭据,因此无法向 Citrix 虚拟应用和桌面 进行身份验证。因此,您必须配置 交付控制器 以信任来自 StoreFront 的请求,请参阅 Citrix 虚拟应用和桌面 安全注意事项和最佳实践

使用联合身份验证服务对 VDA 进行单点登录

使用 SAML 身份验证时,StoreFront 无法访问用户的凭据,因此默认情况下无法对 VDA 进行单点登录。您可以使用 联合身份验证服务 提供单点登录。