Skip to main content
Version: v4

認證機制整合

透過 LDAP 與 Canner Enterprise 整合的優化步驟,可以透過以下操作整合 Microsoft Active Directory 以及任何 LDAP 相關服務。

在此使用 JumpCloud 為範例。

Step 1. 取得必要資訊

本章節將會使用 JumpCloud 平台取得必要資訊,請先確認您已經註冊並登入 JumpCloud,並且已經建立好一個組織,為了能夠將資訊同步至 Kyycloak,在此我們需要取得 Users DNBind DN

Users DN 通常是 ou=Users,o={organizationId},dc=jumpcloud,dc=com,通常可在 JumpCloud 的 LDAP 設定頁面找到。 image

Bind DN 通常是 uid={username}.ou=Users,o={organizationId},dc=jumpcloud,dc=com,通常可以在 JumpCloud 的 User 頁面的 User Detail 中找到。 image

Step 2. 連線方式設定

在登入 Keycloak 之前,請通過 Canner Enterprise 的系統管理員取得 Keycloak 的登入憑證。
在 Standalone 環境下,Keycloak 的登入路徑為 http(s)://{host}/sso/auth

基本設定

  1. 登入 Keycloak 的 Administration Console,確保 Realm 設定正確。 image

  2. 在左側選單中選擇 Configure > User Federation,進入 User Federation 頁面後,選擇 Add provider...並選擇 LDAP。 image image

LDAP 欄位說明

#欄位名稱說明本篇輸入範例
1Console Display NameDisplay Nameldap
2Priority當同一個 Realm 中有多個 Provider 時,Provider 數字越小,表示越優先被使用0 (預設值)
3Import Users若選擇"On",Windows AD 中的使用者會被同步至 Keycloak 的資料庫中On (預設值)
4Edit Mode– READ_ONLY:從 LDAP 同步到 Keycloak,在 Keycloak 不可更新數據
– WRITABLE:Keycloak 與 LDAP 雙向同步
– UNSYNCED:從 LDAP 同步到 Keycloak,在 Keycloak 可更新數據
UNSYNCED
5Sync Registrations若選擇"On",LDAP 新增的 User 會即時同步到 KeycloakOFF (預設值)
6Vendor提供目錄或認證的提供者Other
7Username LDAP attribute所登入帳號的 LDAP 屬性,通常是 cn 或 uidcn (預設值)
8RDN LDAP attribute對應到 LDAP RDN 屬性,通常是 cncn (預設值)
9UUID LDAP attribute對應到 LDAP UUID 屬性,用於對應單一帳號,通常是 objectGUIDobjectGUID (預設值)
10User Object Classes指定 User 的屬性,通常是 person, organizationalPerson, userperson, organizationalPerson, user (預設值)
11Connection URLWindows AD (或 LDAP)的網路位置,通常是 ldap://開頭ldap://{IP or hostname}
12Users DN指定某個節點向下的所有物件,通常會指定一個 OUou=Users,o=602e0xxxxxxxxxxxxc55x9bc,dc=jumpcloud,dc=com
13Custom User LDAP Filter如果要過濾特別的屬性,可以在這個欄位指定參考 LDAP 查詢語法
14Search Scope– One Level:只讀取 Users DN 同一層
– Subtree:讀取 Users DN 向下所有階層
Subtree
15Bind Type指定 Windows AD (或 LDAP)驗證方式,simple 表示使用帳號/密碼simple
16Bind DN指定 Windows AD (或 LDAP)的驗證帳號uid=canner-qa.ou=Users,o=602e0xxxxxxxxxxxxc55x9bc,dc=jumpcloud,dc=com
17Bind CredentialWindows AD (或 LDAP)驗證帳號的密碼********

測試連線與驗證

  1. 在畫面右邊有 "Test connection" 與 "Test authentication" 按鈕,這兩個按鈕可以提供連接與驗證測試,都通過後點擊下方 "Save" 存檔。 image

Step 3. 為 LDAP User 建立基本權限

Canner Enterprise 對客戶的資料安全與權限控管有嚴格的要求,因此每個使用者都必須要有一個基本的權限,才能夠使用 Canner Enterprise 的服務。
此步驟將為 LDAP User 建立基本權限。

建立 Group

  1. 在點擊 "Synchronize all users" 同步使用者到 Keycloak 之前,請先在從左側 Groups 選單中進入 User Groups,並點擊 "New" 建立一個 Group 為稍後同步 User 做準備。 imageimage

為 Group 建立基本權限

  1. 將新增完成後點選 Role Mappings Tab 並將 ac:{uuid}:member 從 Available Roles 移動到 Assigned Role 中。 imageimage

建立 Mapper

  1. 回到 User Federation > LDAP 頁面,並點擊 Mappers Tabs 切換到 LDAP Mappers 頁面並點擊 "Create" 按鈕。 image

  2. 如下圖所示,Mapper Type 請選擇 msad-user-account-control-mapper 並在 Group 欄位輸入剛才建立的 group name 並點擊 "save" 儲存。 image

同步 User

  1. 最後回到 User Federation > LDAP 頁面至最下方點擊 "Synchronize all users" 按鈕即可將 User 全部同步至 Canner Enterprise。 image

測試登入

  1. 完成上述步驟之後, 您可以使用 LDAP User 的帳號密碼登入 Canner Enterprise。

    Canner Enterprise 登入路徑為http(s)://{host}/web

    image

  2. 登入成功後您將會看到 Canner Enterprise 的首頁。 image