> For the complete documentation index, see [llms.txt](https://docs.coreway.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coreway.com/coreway-hr/zh-hk/sso/idp-config.md).

# 第三步：匯入企業身份源設定並儲存

回到 **安全 → 企業登入 → 企業身份源** 區塊，把上一步在 Okta 取得的資訊填回系統。

<figure><img src="https://1973974622-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBZneYuSUsErYNDcsI8Fx%2Fuploads%2Ff6baiUMmiusf3kaCCUOy%2Fimage.png?alt=media&amp;token=f7798e5e-dbb6-4685-9420-ff7ba0beb350" alt=""><figcaption></figcaption></figure>

## 3.1 選擇協定

先在「協定」選 **OIDC** 或 **SAML 2.0**，下方欄位會跟著切換。

{% hint style="warning" %}
已經儲存過身份源後再切換協定，儲存時會提示：**儲存後會切換協定，企業身份源裡也需要按新協定重新登記**。切換等於整組設定重來，請確認 Okta 側也已建立對應協定的應用。
{% endhint %}

## 3.2 用匯入自動帶入參數（建議）

不必逐項手填，貼上一個地址即可帶出全部端點：

{% stepper %}
{% step %}

## 貼上網址

在「Discovery 地址」（OIDC）或「IdP 中繼資料地址」（SAML）欄位貼上第二步複製到的網址。
{% endstep %}

{% step %}

## 匯入

點 **匯入**。
{% endstep %}

{% step %}

## 檢查欄位

檢查下方欄位是否已自動帶入。
{% endstep %}

{% step %}

## 儲存

點 **儲存**。
{% endstep %}
{% endstepper %}

{% hint style="info" %}

* **只支援 https 地址。**
* 匯入會**覆蓋**下方已填的設定，且**要按儲存後才生效**；只匯入不儲存等於沒改。
* OIDC 的 **Client ID / Client Secret 不會被匯入覆蓋**，這兩項需自行填寫。
  {% endhint %}

## 3.3 OIDC 欄位說明

| 欄位            | 必填 | 來源／說明                   |
| ------------- | -- | ----------------------- |
| Client ID     | ✅  | Okta 應用的 Client ID      |
| Client Secret | ✅  | Okta 應用的 Client Secret  |
| Issuer        |    | 匯入自動帶入                  |
| 授權地址          | ✅  | 匯入自動帶入（`/v1/authorize`） |
| 權杖地址          | ✅  | 匯入自動帶入（`/v1/token`）     |
| 用戶資訊地址        |    | 匯入自動帶入（`/v1/userinfo`）  |
| JWKS 地址       |    | 匯入自動帶入（`/v1/keys`）      |

{% hint style="info" %}
已儲存過的 Client Secret 再次開啟頁面時會顯示為 `**********`，提示「保持原樣表示不修改」。要更換金鑰時才需清空重填；若把它清成空值會無法通過必填驗證。
{% endhint %}

## 3.4 SAML 2.0 欄位說明

<figure><img src="https://1973974622-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBZneYuSUsErYNDcsI8Fx%2Fuploads%2FIKP4nnSIUK1HJEXarkjw%2Fimage.png?alt=media&amp;token=52834137-826d-46f3-bf48-d62e4cb87a5d" alt=""><figcaption></figcaption></figure>

| 欄位        | 必填 | 來源／說明                                                            |
| --------- | -- | ---------------------------------------------------------------- |
| Entity ID | ✅  | Okta 中繼資料中的 `entityID`，格式類似 `http://www.okta.com/exk...`         |
| 單一登入地址    | ✅  | Okta 的 SAML SSO URL                                              |
| 單一登出地址    |    | Okta 的 Single Logout URL，需在 Okta 應用中啟用 SLO 才會有值                  |
| NameID 格式 |    | `emailAddress` 或 `unspecified`，需與 Okta 的 Name ID format 一致       |
| 簽章憑證      |    | Okta 的 X.509 公開憑證，匯入中繼資料會自動帶入                                    |
| 配對值來源     |    | `NameID`（預設）或 `斷言中的屬性`                                           |
| 屬性名稱      | 條件 | 「配對值來源」選「斷言中的屬性」時必填，填 Okta Attribute Statement 中的屬性名稱，例如 `email` |
| 對登入請求簽章   |    | 企業身份源要求 AuthnRequest 簽章時開啟                                       |
|           |    |                                                                  |

### 配對值來源怎麼選

| 情境                       | 選擇                                |
| ------------------------ | --------------------------------- |
| Okta 的 Name ID 就是成員電郵    | **NameID**                        |
| Name ID 是使用者名稱、員工編號等非電郵值 | **斷言中的屬性**，並在「屬性名稱」填入帶有電郵或手機號碼的屬性 |

無論選哪一種，回傳的值最後都要能對上成員的電郵或手機號碼，見 [第四步](/coreway-hr/zh-hk/sso/member-account.md)。

## 3.5 統一登出

「登出時同時退出企業身份源」預設關閉，此時成員登出只會登出本系統，企業身份源仍維持登入狀態。

開啟後：

* 成員登出會跳轉到企業身份源的登出地址。
* **必須**先在企業身份源登記本系統的「登出回跳地址」（開啟開關後登記區會多顯示這一列），否則成員會停在對方的登入頁回不來。
* 若設定裡沒有企業身份源的登出地址，欄位下方會出現橘色提示：**設定裡沒有企業身份源的登出地址，請重新匯入一次設定地址**。此時請確認 Okta 應用已啟用 Single Logout，再重新匯入一次。

<figure><img src="https://1973974622-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBZneYuSUsErYNDcsI8Fx%2Fuploads%2FO0IDZ6vM1cdoKO2whvZH%2Fimage.png?alt=media&amp;token=d3073f4b-a6d8-456c-b5ad-06d5c9d9ef4d" alt=""><figcaption></figcaption></figure>

## 3.6 儲存

填寫完成後點該區塊的 **儲存**。

* 若尚未儲存組織代碼，會提示「請先儲存組織代碼」，請先回到 [第一步](/coreway-hr/zh-hk/sso/login-code.md)。
* **首次儲存企業身份源後，企業登入會自動啟用**，頁面上方的開關會變成「已啟用」。

下一步 → [第四步：設定成員企業帳號](/coreway-hr/zh-hk/sso/member-account.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.coreway.com/coreway-hr/zh-hk/sso/idp-config.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
