> 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/register.md).

# 第二步：在企業身份源建立應用並登記地址

這一步要做兩件事：先從本系統複製需要登記的地址，再到企業身份源（Okta）建立應用並把這些地址填進去。

## 2.1 複製登記資訊

在 **安全 → 企業登入** 頁面最下方的「登記到企業身份源」區塊，會依你選擇的協定顯示對應的地址。點欄位值或右側的複製圖示即可複製。

<figure><img src="https://1973974622-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBZneYuSUsErYNDcsI8Fx%2Fuploads%2FYnj2k9xVzPWz74sVDDw2%2Fimage.png?alt=media&amp;token=2977b416-db8c-490f-8046-9ab74d89c417" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
顯示的地址由系統依團隊代碼自動產生，**請一律從頁面複製**，不要照抄本文的範例值。切換協定（OIDC ⇄ SAML）後顯示的項目會跟著變。
{% endhint %}

### SAML 2.0

| 項目           | 範例值                                                                                |
| ------------ | ---------------------------------------------------------------------------------- |
| SP Entity ID | `https://passport.example.com/auth/realms/sso`                                     |
| 斷言消費地址（ACS）  | `https://passport.example.com/auth/realms/sso/broker/sso-acme/endpoint`            |
| 中繼資料地址       | `https://passport.example.com/auth/realms/sso/broker/sso-acme/endpoint/descriptor` |

若部分身份平台支援直接匯入 SP 中繼資料，可以把「中繼資料地址」交給對方，省去逐項填寫。

### OIDC

| 項目       | 範例值                                                                     |
| -------- | ----------------------------------------------------------------------- |
| 重新導向 URI | `https://passport.example.com/auth/realms/sso/broker/sso-acme/endpoint` |

### 統一登出（兩種協定共用）

若你打算開啟「登出時同時退出企業身份源」，登記區會多出一列：

| 項目     | 範例值                                                                                     |
| ------ | --------------------------------------------------------------------------------------- |
| 登出回跳地址 | `https://passport.example.com/auth/realms/sso/broker/sso-acme/endpoint/logout_response` |

這一列必須同時登記到企業身份源，否則成員登出後會停在對方的登入頁。詳見 [第三步的統一登出說明](/coreway-hr/zh-hk/sso/idp-config.md)。

## 2.2 在 Okta 建立 SAML 2.0 應用

{% stepper %}
{% step %}

### 建立應用整合

登入 Okta 管理後台，前往 **Applications → Applications → Create App Integration**。

<figure><img src="https://1973974622-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBZneYuSUsErYNDcsI8Fx%2Fuploads%2FHWAVPVvii42lMjqlLWjg%2Fimage.png?alt=media&amp;token=1697eab8-a0c0-4c8e-aa34-32948f681504" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 選擇協定

選擇 **SAML 2.0**，點 **Next**。

<figure><img src="https://1973974622-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBZneYuSUsErYNDcsI8Fx%2Fuploads%2Fscca8hIYNaFUXdv3xK0v%2Fimage.png?alt=media&amp;token=bd70cfdc-e896-4c9b-bedf-762cd4cc96f3" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 填寫一般設定

在 **General Settings** 填寫 App name（例如 `YOOV`），可上傳 Logo，點 **Next**。

<figure><img src="https://1973974622-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBZneYuSUsErYNDcsI8Fx%2Fuploads%2FVWgx1HtWML4Yt4eNjm57%2Fimage.png?alt=media&amp;token=0137dbb6-f6ee-440d-bfeb-6cd750bda1e1" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 設定 SAML

在 **Configure SAML**，按下表填寫：

<figure><img src="https://1973974622-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBZneYuSUsErYNDcsI8Fx%2Fuploads%2FFpVG66iNm3FRANgQT4SJ%2Fimage.png?alt=media&amp;token=42bed4f8-b7c8-429c-ab8d-9ccbd737b70d" alt=""><figcaption></figcaption></figure>

| Okta 欄位                                        | 填入                 |
| ---------------------------------------------- | ------------------ |
| Single sign-on URL                             | 本系統的「斷言消費地址（ACS）」  |
| Use this for Recipient URL and Destination URL | 勾選                 |
| Audience URI (SP Entity ID)                    | 本系統的「SP Entity ID」 |
| Name ID format                                 | `EmailAddress`     |
| Application username                           | `Email`            |
| {% endstep %}                                  |                    |

{% step %}

### 增加屬性（選用）

在 **Attribute Statements** 增加屬性，例如 `email → user.email`、`mobile → user.primaryPhone`。若之後打算用「斷言中的屬性」而非 NameID 來配對，這一步必填。

<figure><img src="https://1973974622-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBZneYuSUsErYNDcsI8Fx%2Fuploads%2FY65WMEMh0E76ugM0cWSv%2Fimage.png?alt=media&amp;token=528430fa-33b0-4e50-a086-aafaa72ccfd4" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}

### 設定統一登出（選用）

若要啟用統一登出，展開 **Show Advanced Settings**，勾選 **Enable Single Logout**，把本系統的「登出回跳地址」填入 **Single Logout URL**，並依 Okta 要求上傳簽章憑證。
{% endstep %}

{% step %}

### 完成建立

點 **Next → Finish**。
{% endstep %}

{% step %}

### 指派使用者或群組

切到 **Assignments** 分頁，把需要使用 SSO 的使用者或群組指派給這個應用。
{% endstep %}

{% step %}

### 複製中繼資料網址

切到 **Sign On** 分頁，找到 **SAML Setup Instructions** 或 **Identity Provider metadata** 連結，複製**中繼資料網址**，格式類似：

`https://<your-okta-domain>/app/<appId>/sso/saml/metadata`
{% endstep %}
{% endstepper %}

{% hint style="info" %}
複製到的中繼資料網址，下一步要貼回本系統的「IdP 中繼資料地址」欄位。
{% endhint %}

## 2.3 在 Okta 建立 OIDC 應用

{% stepper %}
{% step %}

### 建立應用整合

前往 **Applications → Applications → Create App Integration**。
{% endstep %}

{% step %}

### 選擇登入方法與應用類型

**Sign-in method** 選 **OIDC - OpenID Connect**，**Application type** 選 **Web Application**，點 **Next**。
{% endstep %}

{% step %}

### 填寫應用設定

按下表填寫：

| Okta 欄位                | 填入                        |
| ---------------------- | ------------------------- |
| App integration name   | 例如 `YOOV`                 |
| Grant type             | 勾選 **Authorization Code** |
| Sign-in redirect URIs  | 本系統的「重新導向 URI」            |
| Sign-out redirect URIs | 本系統的「登出回跳地址」（只在使用統一登出時需要） |
| {% endstep %}          |                           |

{% step %}

### 指派使用者或群組

在 **Assignments** 指派使用者或群組，點 **Save**。
{% endstep %}

{% step %}

### 複製 Client 資訊

在應用的 **General** 分頁複製 **Client ID** 與 **Client Secret**。
{% endstep %}

{% step %}

### 記下 Discovery 地址

* 使用 Okta 預設授權伺服器：`https://<your-okta-domain>/.well-known/openid-configuration`
* 使用自訂授權伺服器：`https://<your-okta-domain>/oauth2/<authServerId>/.well-known/openid-configuration`
  {% endstep %}
  {% endstepper %}

{% hint style="info" %}
使用其他身份管理平台的團隊，請改看對應附錄再回到第三步：\[Microsoft Entra ID]\(附錄：Microsoft Entra ID 設定範例.md)、\[Google Workspace]\(附錄：Google Workspace 設定範例.md)。
{% endhint %}

下一步 → [第三步：匯入企業身份源設定並儲存](/coreway-hr/zh-hk/sso/idp-config.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/register.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.
