ThingWorx Navigate 入门 > 安装 ThingWorx Navigate > 配置 ThingWorx Navigate 使用 Windchill 身份验证
  
配置 ThingWorx Navigate 使用 Windchill 身份验证
此选项对 ThingWorx 使用 Windchill 身份验证。对于打开浏览器并跳转至混搭或任何 ThingWorx URL 的用户,系统会将其路由至 Windchill 进行身份验证。身份验证完成后,浏览器会路由回混搭或 ThingWorx 中的另一个页面,用户能够以在 Windchill 中验证的用户身份访问 ThingWorx 或混搭。有关技术详细信息,请参阅Windchill 体系结构身份验证
此配置要求同一用户同时存在于 WindchillThingWorx 中。ThingWorx Navigate 提供当用户已在 Windchill 中验证之后,在 ThingWorx 中自动创建这些用户的选项。如果未启用此选项,则用户必须同时独立存在于 WindchillThingWorx 中。在 ThingWorx 中创建用户后,管理员需要将用户添加到指定的 ThingWorx 组中,以支持访问 ThingWorx Navigate 任务。有关详细信息,请参阅修改 ThingWorx 权限
* 
必须配置 Windchill 使用 SSL。我们还建议配置 ThingWorx 使用 SSL。有关详细信息,请参阅使用 SSL 进行安全通信
完成以下步骤以配置 ThingWorx Navigate 使用 Windchill
1. 如果 EnableSSO 出现在 platform-settings.json (ThingworxPlatform) 中,请将其设置为 false 并重新启动 Tomcat。
* 
如果它未出现在 platform-settings.json 中,并且您使用的是预置 platform-settings.json,则可以跳到步骤 2。
2. 打开 ptc-windchill-integration-connector 并选择“配置”
“身份验证类型”设置为 None
不需要填写“用户名”“密码”
填写“基本 URL”https://<Windchill 主机名>:<端口>/Windchill/sslClientAuth
,然后单击“保存”
3. 打开 ptc-windchill-integration-connector-proxy 并选择“配置”
URLhttps://<Windchill 主机名>
“身份验证类型”设置为 Session User
不需要填写 UsernamePassword
SSL Connection Configuration 中指定 KeystoreTrustStore 信息的路径,并添加密码。
Session User Configuration 中,验证 wt.effectiveUidSession User Query Parameter 的值,除非在 Windchill 中另有说明。
4. 要测试 ThingWorx Navigate 配置,请执行下列步骤:
ThingWorx Composer 中,前往 ptc-windchill-integration-connector,选择“服务”并执行“验证连接”服务。以下消息确认与 Windchill 服务器的连接成功:Success - 200-OK - WindchillSwaggerConnector
要确认是否可以从 Windchill 服务器获取数据,请打开 ThingWorx Navigate 登录页面的 URL:http://<host>:<port>/Thingworx/Runtime/index.html?master=PTC.AccessApp.Master&mashup=LandingPageAccessAppMashup
配置 PTC 标识提供工具身份验证器
下列步骤将介绍如何配置 PTC 标识提供工具身份验证器。
1. 在左侧导航窗格的“安全”下选择“身份验证器”
2. 单击 ptc-identity-provider-authenticator 链接以显示有关扩展的常规信息。“常规信息”页面随即打开。
3. “常规信息”页面中,完成下列步骤:
a. 选择“启用”复选框。
b. “优先级”字段中输入值。默认情况下,优先级为 1 表示此身份验证器是要运行的第一个身份验证器。
如果要通过多个身份验证器进行检查,则在“优先级”字段中设置的值很重要。如果优先级为 1 的身份验证器失败,则由下一个身份验证器执行身份验证检查,依此类推。
4. 在左侧导航窗格的“实体信息”下,单击“配置”
结合选项 CreateUserDynamicallyHomeMashup 使用单一登录,可以使通过 Windchill 进行身份验证的用户自动添加为 ThingWorx 用户并分配主混搭。当用户第一次打开浏览器并跳转至 ThingWorx 时,它们会被路由至 Windchill 进行身份验证。身份验证完成后,会在 ThingWorx 中创建相应用户,并为用户分配主混搭。然后,浏览器会被路由至指定的主混搭。
CreateUserDynamically - 选中后,如果用户在 ThingWorx 中不存在并且已经由 Windchill 进行了身份验证,则将身份验证器配置为自动创建用户。
如果身份验证器未配置为自动创建用户,则浏览器仍会转至 Windchill 进行身份验证,但如果用户不存在,则无法打开 ThingWorx
* 
如果用户收到错误消息 #500,则表明该用户在 ThingWorx 中不存在。
HomeMashup - 为新创建的用户分配主混搭。如果未指定任何主混搭,则 ThingWorx 会将浏览器路由至 ThingWorx 搜索页面。
对于 ThingWorx Navigate,设置为 LandingPageAccessAppMashup
5. 确保为使用 HomeMashup 字段的所有动态创建的用户 (如上一步所述),或用户“常规信息”页面上的现有用户 (管理用户除外) 设置主混搭值。如果没有为常规用户设置主混搭,则会将该用户重定向到默认 ThingWorx 搜索页面。
6. 单击“保存”
必须将用户添加到指定的组中。有关详细信息,请参阅修改 ThingWorx 权限
将 Servlet 筛选器添加到 Tomcat 配置
可使用 Windchill IdP 验证筛选器,将 ThingWorx 未验证的用户重定向到 Windchill 登录表单以获取身份验证凭据。成功完成身份验证后,ThingWorx 应用程序会接收到密钥和用户名。
筛选器在 ThingWorx 端的 web.xml 文件 (ThingWorx Tomcat 安装目录下) 中进行配置。请执行以下步骤:
1. 停止 Tomcat 和 Integration Runtime。
2. ptc-identity-provider-authentication-filter-{版本}.jarptc-windchill-extension-bundle 中的 idp 文件夹复制到 ThingWorx Tomcat 安装目录下的 WEB-INF/lib 目录。
3. 转到 web.xml 文件,位于 Tomcat-install\webapps\Thingworx\WEB-INF\web.xml
4. Tomcat-install\webapps\Thingworx\WEB-INF 复制 web.xml 文件,并将其保存到其他位置。
5. Tomcat-install\webapps\Thingworx\WEB-INF 中的 web.xml 替换为 ptc-windchill-extension-bundle\idp\twx-8.1.x 中的 web.xml
6. 打开 web.xml,添加以下筛选器中 [http or https]://[windchill-host]:[windchill-port]/windchill-web-app]Windchill Server 详细信息:IdentityProviderAuthenticationFilterIdentityProviderKeyValidationFilter
7. 启动 Tomcat 和 Integration Runtime。
* 
Windchillweb.xml 中定义了 authparam 值后,预置值不再有效。要获取正确的数据,请更改 ptc-windchill-integration-connector-proxySession User Query Parameter 的值。
验证配置
WindchillThingWorx 二者都需要同意管理员用户的名称。请考虑下列选项:
如果您未在 Windchill 中进行更改,则名为 "Administrator" 的管理员用户已在安装 Windchill 时创建。使用配置的 ThingWorx 系统时,您可以作为该用户进行身份验证并具有像 ThingWorx 中的管理员用户一样的完全访问权限。
如果您已修改 Windchill,使得名为 "Administrator" 的用户不存在,则必须确定一个 WindchillThingWorx 通用的用户名,并将该用户添加到 ThingWorx 和 Administrators 用户组。
要验证 Windchill 身份验证配置,打开浏览器并转至 ThingWorx URL。浏览器会路由至 Windchill 进行身份验证。为 Administrator (或配置为 ThingWorx 管理员的其他用户) 提供 Windchill 凭据。浏览器会路由回 ThingWorx,随即打开 ThingWorx Composer。验证您当前是否正在以该用户的身份运行 ThingWorx。这将验证是否正确配置 ThingWorx 使用 Windchill 身份验证。
如果您已选择让身份验证器自动创建用户,请在下一步中进行测试。要进行验证,请打开浏览器并跳转至 ThingWorx URL。浏览器会转至 Windchill 进行身份验证。提供不存在于 Windchill 中的用户的 ThingWorx 凭据。浏览器会路由回 ThingWorx 中指定为主混搭的页面。验证您当前是否正在以正确的用户身份运行 ThingWorx