---
schema_version: "1"
id: fb840c82295a1f0582f71cfa66954788a619cf54d68479ed0d20615b68ca9905
title: 設定適用於 SAP HANA 的外部 OAuth
collection: tableau
version: current
locale: zh-tw
portal_url: https://docs.salesforce.com/tableau/current/zh-tw/server/config_oauth_hana.md
canonical_url: https://help.tableau.com/current/server/zh-tw/config_oauth_hana.htm
source_site: help.tableau.com
content_type: documentation
content_hash: bf83add0ac6fed09ab2075d882ccd632fd2f70b0e0fa066f063edd2d170acdf6
description: Configure external OAuth 2.0/OIDC identity federation for SAP HANA in Tableau Cloud.
---
[跳至主要內容](#main-content)

# 設定適用於 SAP HANA 的外部 OAuth

從 Tableau Cloud 的Tableau 2024.3 開始，可以使用 OAuth 2.0/OIDC 將外部身分提供程式的身分與 HANA 結成同盟。

根據身分提供程式的不同，設定整合需要執行不同的步驟。這是一個高層級的概觀。

## 在 HANA 上設定 IDP

有關在 HANA 上設定 IdP 的資訊，請參閱 SAP 說明系統中的[使用 JSON Web 權杖進行單一登入](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-security-guide/single-sign-on-using-json-web-tokens)。

以下是設定 IdP 不同方法的一些範例：

- 使用 HANA Cockpit 的 Okta IdP：[使用 Okta 身分存取 SAP HANA Cloud](https://help.alteryx.com/current/zh/designer/data-sources/sap-hana/connect-to-sap-hana-cloud-with-okta-account.html#connect-to-sap-hana-cloud-with-okta-account)
- 使用 HANA Studio 的 Azure IdP：[使用 OAuth 或 SSO 設定 SAP HANA 執行個體](https://www2.microstrategy.com/producthelp/Current/Gateway_Connections/WebHelp/Lang_1033/Content/sap_hana_instance_oauth_sso.htm)

## 設定 IDP

1. 在 Tableau Desktop、Tableau Server 或 Tableau Cloud 的 IDP 上建立 OAuth 用戶端。Desktop 用戶端應啟用 [`PKCE`](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow-with-pkce) 並使用 `http://localhost` 重新導向。
2. 建立 Tableau OAuth 設定檔。有關如何執行此動作的詳細資訊，請參閱 [Github](https://tableau.github.io/connector-plugin-sdk/docs/oauth "有關 GitHub 的 OAuth 文件") 上的 [OAuth 設定和使用](https://tableau.github.io/connector-plugin-sdk/docs/oauth)以及[此處](https://github.com/tableau/connector-plugin-sdk/tree/master/samples/components/oauth "有關 GitHub 的 OAuth 範例。")的範例。我們歡迎其他 IDP 的範例。
    
    1. 請務必在 Tableau OAuth 設定 ID 前面加上「`custom_`」首碼。
        
        **附註：**OAuth 設定 ID 不得超過 36 個字元。超過此長度的 ID 可能不會產生錯誤，但會無法運作。
    2. 如果您的 IDP 支援動態 localhost 連接埠，則停用 `OAUTH_CAP_FIXED_PORT_IN_CALLBACK_URL`。若您的 IDP 不支援此功能，請確保將多個本機主機回呼 URL 新增至設定檔和 IDP 上的允許清單中。
3. 透過站台設定頁面，在與桌面主機（Tableau Desktop、Tableau Prep Builder、Tableau Bridge）上以及將使用 OAuth 的每個 Tableau Server 和 Tableau Cloud 站台上每個應用程式關聯的 `OAuthConfigs` 資料夾中安裝新的 Tableau OAuth 設定檔。有關詳情，請參閱 [Desktop 上的自訂 OAuth 設定](https://tableau.github.io/connector-plugin-sdk/docs/oauth#custom-oauth-configs-on-desktop) 和 [站台層級 OAuth 用戶端](https://tableau.github.io/connector-plugin-sdk/docs/oauth#site-level-oauth-clients)。

## 連線到 HANA

使用者必須選取使用 OAuth 登入，然後選取先前安裝的 OAuth 提供程式。

![](/tableau/current/zh-tw/server/zh-tw/Img/hana_connect.png)

## Okta

若使用 Okta，最好使用「自訂授權伺服器」，而不是「組織授權伺服器」。自訂授權伺服器具有更多彈性。系統會預設建立一個自訂授權伺服器，稱為「預設」。授權 URL 應如下所示：

https://${yourOktaDomain}/oauth2/{authServerName}/v1/authorize

![](/tableau/current/zh-tw/server/zh-tw/Img/redshift_oauth_iam_okta_800x332.png)