创建 PingFederate 连接
在 PingFederate 中,您可以创建客户端端点,在获取或验证访问令牌或验证用户时,您的 SSO 解决方案中的应用程序会连接到这些客户端端点。建议您为应用程序在您的 SSO 解决方案中担任的每一个角色创建一个单独的客户端。这样您就可以微调该角色所对应客户端中的设置。
对于 ThingWorx SSO,需要在 PingFederate 中创建以下客户端:
用于 ThingWorx 并作为服务提供工具的 SP 连接
用于 ThingWorx 并作为服务提供工具的 OAuth 客户端
有关创建和配置 PingFederate 连接的详细信息,请参阅 PingFederate 文档或寻求 PingIdentity 客户支持。以下过程包含 ThingWorx SSO 所需的设置,但是您企业的 SSO 解决方案可能会需要其他设置。
用于 ThingWorx 并作为服务提供工具的 SP 连接
此连接可用于 SAML 身份验证。ThingWorx 会将用户登录请求指向 PingFederate。
1. IDP Configuration 页面,选择 SP Connections,然后单击 Create New
2. Connection Type 部分,选择 Browser SSO Profiles 以指定 SAML 2.0 协议。
3. Connection Options 部分,选择 Browser SSO
4. General Info 部分,执行以下操作:
a. Partner’s Entity ID (Connection ID) 设置为唯一值。请记下此 ID 以便后续用于配置 sso-settings.json 文件。
b. Connection Name 字段添加描述性名称。该名称将显示在 SP 连接列表中。
c. Base URL 设置为托管 web 应用程序 (ThingWorx) 服务提供工具的 URL。
5. Protocol Settings 部分,将 Assertion Consumer Service URL Endpoint 设置为 URL:/Thingworx/saml/SSO
6. Credentials 部分,将 Digital Signature Settings 设置为 Selected Certificate
7. Signature Verification 部分,为以下内容添加许可证:
Signature Verification Certificate: Selected Certificate
Signature Verification Certificate: Selected Encryption Certificate
Select XML Encryption Certificate: Selected Encryption Certificate
8. 确认新服务提供工具处于激活状态。查看 SP 连接。Activation & Summary 页面顶部的单选按钮指示符应设置为 Active
9. 单击 Save
PingFederate 使用名为策略合约的机制来桥接 PingFederate 所依赖的服务提供工具和标识提供工具。您将需要为此 SP 连接创建策略合约。在创建过程中,请列出应在 SAML 断言中交换的所有属性。
有关详细信息,请参阅 PTC 单一登录架构和配置概述指南中的“使用第三方标识提供工具”一节。
用于 ThingWorx 并作为服务提供工具的 OAuth 客户端
OAuth 客户端是 PingFederate 向 ThingWorx 提供访问令牌的连接点。ThingWorx 会使用这些访问令牌向资源提供者请求受 OAuth 保护的资源。
1. OAuth Settings 页面上,选择 Clients 部分,然后单击 Create New
2. Client ID 字段中,输入一个值。该值会被用作配置 sso-settings.json 文件时使用的 AuthorizationServersSettings.<AuthServerId>.clientId 参数值。
3. 选择 Client Secret 并输入客户端密钥值。请记下此值,因为该值会被用作配置 sso-settings.json 文件时使用的 AuthorizationServersSettings.<AuthServerId>.clientSecret 参数值。
4. Name 字段中,输入一个值。此值会显示在 PingFederate 客户端列表中。
5. Description 字段中,输入说明。
6. Redirect URIS 部分,输入 ThingWorx 服务器重定向 URI。例如:http://<我的服务器>:<我的端口>/Thingworx/oauth2_authorization_code_redirect.,其中 <我的服务器> 是您的 ThingWorx 服务器。
* 
如果您在配置为 SSO 的 ThingWorx Foundation 实例上安装 ,请将此值指定为 https://<ThingWorx Flow Nginx 主机名>:<ThingWorx Flow Nginx 端口号>/Thingworx/oauth2_authorization_code_redirect
7. Allow Grant Types 部分,选择 Refresh TokenAuthorization Code
8. Persistent Grants Expiration 部分,选择 Grants Do Not Expire
9. Refresh Token Rolling Policy 部分,选择 Roll