Spotfire® 用户指南

在 Spotfire Web 客户端中启用 Google 连接器

要在 Spotfire Web 客户端中访问来自 Google BigQuery 和 Google Analytics 的数据,您必须确保 Web 客户端可以访问 Google API。此操作需要在 Google 项目和 Spotfire 中进行一些配置。

需要执行以下步骤:
  • 在 Google 项目中,您必须设置要用于 Spotfire 的 OAuth 凭据,并输入 Spotfire 客户端的重定向 URI。
  • 在 Spotfire 中,您必须使用 Google 项目的 OAuth 客户端 ID 和客户端密钥配置 Web Player 服务。

先决条件

必须在您的 Google 项目中启用 Google BigQuery 和/或 Google Analytics API。

注: 要使用 Google BigQuery 连接器,请确保 Google 项目具有查看和管理 BigQuery 数据所需的 OAuth 2.0 作用域。

配置 Google 项目

在 Google API 控制台中,在 Google 项目中为 Spotfire 创建 OAuth 凭据。

有关如何在 Google Cloud Platform 中设置和配置 OAuth 凭据的详细说明,请参阅 Google 提供的官方文档。

客户端 ID 和客户端密钥
为 Google Cloud Platform 项目创建 OAuth 凭据时,请记下客户端 ID 和客户端密钥。
重定向 URI
在 OAuth 凭据中,为 Spotfire 服务器添加以下地址作为重定向 URI:
  • https://<spotfire_server>/spotfire/wp/oauth2/code

配置 Spotfire Web 客户端

将“客户端 ID”和“客户端密钥”添加到您的 Web 客户端的 Web 客户端服务配置。在配置文件 Spotfire.Dxp.Worker.Host.exe.config 中添加这些设置。

  1. 在运行 Spotfire Server 的计算机上,导出要编辑的服务配置。请参见您的 Spotfire 版本的《Spotfire Server 和环境 - 安装和管理手册》手动编辑服务配置文件主题中的说明。
  2. Spotfire.Dxp.Worker.Host.exe.config 文件中,找到或添加设置 Spotfire.Dxp.Data.Adapters.GoogleCommon.Properties.Settings
    <Spotfire.Dxp.Data.Adapters.GoogleCommon.Properties.Settings>
      <setting name="ClientId" serializeAs="String">
         <value>My client ID</value>
      </setting>
      <setting name="ClientSecret" serializeAs="String">
         <value>My client secret</value>
      </setting>
    </Spotfire.Dxp.Data.Adapters.GoogleCommon.Properties.Settings>
  3. 分别在设置 ClientIdClientSecret 中添加您的 Client IDClient Secret
  4. 保存更改。然后按照《Spotfire Server 和环境 - 安装和管理手册》中的说明导入服务配置。
注: 如果您使用多个服务配置来配置不同的 Web Player 服务,请确保在所有相关的服务配置中添加这些设置。记住,无法编辑默认服务配置。

管理器中的偏好设置

在早期版本的 Spotfire 中,添加客户端 ID 和客户端密钥信息的方法是使用 Spotfire 管理器中的一组用户组偏好设置。此方法仍可用。

以下偏好设置可从 Connectors > Google Authentication 下访问:
  • ClientID
  • ClientSecret

如果您使用安装了 Spotfire 的客户端,则这些偏好设置也是有效的。

重要: 如果使用该偏好设置,则必须在 Google 项目的 OAuth 凭据中添加其他重定向 URI:http://localhost:55931http://localhost:55932