SAML 身份验证
SAML(安全断言标记语言)是一种由身份和身份验证产品使用的开放标准。使用 SAML,您可以将 StoreFront 配置为将用户重定向到外部身份提供程序进行身份验证。
注意
为内部访问配置 StoreFront 的 SAML 身份验证。对于外部访问,请使用 SAML 身份验证配置 Citrix Gateway,然后使用Gateway 直通身份验证配置 StoreFront。
StoreFront 需要符合 SAML 2.0 的身份提供程序 (IdP),例如:
- 使用 SAML 绑定(而非 WS-Federation 绑定)的 Microsoft AD Federation Services。有关详细信息,请参阅 CTX220638。
- Citrix Gateway(配置为 IdP)。
- Microsoft Entra ID。有关详细信息,请参阅 CTX237490。
SAML 断言必须包含一个 saml:Subject 属性,其中包含用户的 UPN。StoreFront 会在 Active Directory 中查找此 UPN。
要在使用 Citrix Workspace 应用程序连接时为应用商店启用或禁用 SAML 身份验证,请在身份验证方法窗口中选择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-->
配置身份提供程序
-
在SAML 身份验证行中单击设置下拉菜单,然后单击身份提供程序。


-
选择 Post 或 Redirect 的 SAML 绑定。
-
输入身份提供程序的地址。
-
导入用于签署 SAML 令牌的证书。
-
按确定保存更改。
配置服务提供程序
-
在SAML 身份验证行中单击设置下拉菜单,然后单击服务提供程序。

-
(可选)选择一个导出签名证书,用于向身份提供程序签署消息。
-
(可选)选择一个导出加密证书,用于解密从身份提供程序收到的消息。
-
服务提供程序标识符已预先填充了应用商店的身份验证服务。
-
按确定保存更改。
PowerShell
使用 PowerShell:
-
要导入签名证书,请调用 cmdlet Import-STFSamlSigningCertificate。
-
要导入加密证书,请调用 cmdlet Import-STFSamlEncryptionCertificate。
测试
要测试 SAML 集成:
- 转到 SAML 测试页面,请参阅 StoreFront SAML 端点。
- 这会将您重定向到身份提供程序。输入您的凭据。
- 您将被重定向回测试页面,该页面显示身份声明和断言。
配置 Delivery Controller™ 以信任 StoreFront
使用 SAML 身份验证时,StoreFront 无法访问用户的凭据,因此无法向 Citrix Virtual Apps and Desktops 进行身份验证。因此,您必须配置 Delivery Controller 以信任来自 StoreFront 的请求,请参阅 Citrix Virtual Apps and Desktops 安全注意事项和最佳实践。
使用联合身份验证服务对 VDA 进行单点登录
使用 SAML 身份验证时,StoreFront 无法访问用户的凭据,因此默认情况下无法对 VDA 进行单点登录。您可以使用联合身份验证服务提供单点登录。