

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# AWS IAM Identity Center 身分來源入門 （主控台）
<a name="getting-started-aws-sso"></a>

 AWS IAM Identity Center 身分來源包含使用者和群組的相關資訊。這有助於設定使用者內容篩選，其中 會根據使用者或其群組對文件的存取，篩選不同使用者的 Amazon Kendra 搜尋結果。

若要建立 IAM Identity Center 身分來源，您必須啟用 IAM Identity Center，並在 中建立組織 AWS Organizations。當您首次啟用 IAM Identity Center 並建立組織時，它會自動預設為 Identity Center 目錄做為身分來源。您可以變更為 Active Directory (Amazon 受管或自我管理） 或外部身分提供者做為您的身分來源。您必須遵循正確的指引，請參閱[變更您的 IAM Identity Center 身分來源](https://docs.aws.amazon.com/kendra/latest/dg/changing-aws-sso-source.html)。每個組織只能有一個身分來源。

為了讓您的使用者和群組獲得不同層級的文件存取權，您需要在將文件擷取到索引時，將使用者和群組包含在存取控制清單中。這可讓您的使用者和群組根據其存取層級在 Amazon Kendra 中搜尋文件。當您發出查詢時，使用者 ID 必須與 IAM Identity Center 中的使用者名稱完全相符。

您還必須授予使用 IAM Identity Center 所需的許可 Amazon Kendra。如需詳細資訊，請參閱 [IAM IAM Identity Center 的角色](https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html#iam-roles-aws-sso)。

**設定 IAM Identity Center 身分來源**

1. 開啟 [IAM Identity Center 主控台](https://console.aws.amazon.com/singlesignon)。

1. 選擇**啟用 IAM Identity Center**，然後選擇**建立 AWS 組織**。

   Identity Center 目錄預設為建立，並會傳送電子郵件給您，以驗證與組織相關聯的電子郵件地址。

1. 若要將群組新增至您的 AWS 組織，請在導覽窗格中選擇**群組**。

1. 在**群組頁面上**，選擇**建立群組**，然後在對話方塊中輸入群組名稱和描述。選擇**建立**。

1. 若要將使用者新增至您的 Organizations，請在導覽窗格中選擇**使用者**。

1. 在 **Users (使用者)** 頁面上，選擇 **Add user (新增使用者)**。在 **User details (使用者詳細資訊)** 下，指定所有必要欄位。在 **Password (密碼)** 中，選擇 **Send an email to the user (傳送電子郵件給使用者)**。選擇**下一步**。

1. 若要將使用者新增至群組，請選擇**群組**，然後選取群組。

1. 在**詳細資訊**頁面的**群組成員**下，選擇**新增使用者**。

1. 在**新增使用者至群組**頁面上，選取要新增為群組成員的使用者。您可以選取要新增至群組的多個使用者。

1. 若要將使用者和群組清單與 IAM Identity Center 同步，請將您的身分來源變更為 Active Directory 或外部身分提供者。

   Identity Center 目錄是預設身分來源，如果您沒有供應商管理自己的清單，則需要使用此來源手動新增使用者和群組。若要變更您的身分來源，您必須遵循正確的指引，請參閱[變更您的 IAM Identity Center 身分來源](https://docs.aws.amazon.com/kendra/latest/dg/changing-aws-sso-source.html)。

**注意**  
如果使用 Active Directory 或外部身分提供者做為您的身分來源，您必須在指定跨網域身分管理 (SCIM) 通訊協定時，將使用者的電子郵件地址映射至 IAM Identity Center 使用者名稱。如需詳細資訊，請參閱 [SCIM 上的 IAM Identity Center 指南，以啟用 IAM Identity Center](https://docs.aws.amazon.com/singlesignon/latest/userguide/scim-profile-saml.html)。

設定 IAM Identity Center 身分來源後，您可以在建立或編輯索引時，在主控台中啟用此功能。前往索引設定中的**使用者存取控制**，並編輯您的設定，以允許從 IAM Identity Center 擷取使用者群組資訊。

您也可以使用 [UserGroupResolutionConfiguration](https://docs.aws.amazon.com/kendra/latest/APIReference/API_UserGroupResolutionConfiguration.html) 物件啟用 IAM Identity Center。您以 `UserGroupResolutionMode` 的形式提供 ，`AWS_SSO`並建立 IAM 角色，以授予呼叫 `sso:ListDirectoryAssociations`、`sso-directory:SearchUsers`、`sso-directory:ListGroupsForUser`、 的許可`sso-directory:DescribeGroups`。

**警告**  
Amazon Kendra 目前不支援`UserGroupResolutionConfiguration`搭配 AWS IAM Identity Center 身分來源的組織成員帳戶使用 。您必須在組織的管理帳戶中建立索引，才能使用 `UserGroupResolutionConfiguration`。

以下是如何使用 `UserGroupResolutionConfiguration`和使用者存取控制設定資料來源的概觀，以根據使用者內容篩選搜尋結果。這會假設您已建立索引和索引 IAM 的角色。您可以使用 [CreateIndex](https://docs.aws.amazon.com/kendra/latest/APIReference/API_CreateIndex.html) API 建立索引並提供 IAM 角色。

**使用 `UserGroupResolutionConfiguration`和使用者內容篩選設定資料來源**

1. 建立 [IAM 角色](https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html#iam-roles-aws-sso)，提供存取 IAM Identity Center 身分來源的許可。

1. [https://docs.aws.amazon.com/kendra/latest/APIReference/API_UserGroupResolutionConfiguration.html](https://docs.aws.amazon.com/kendra/latest/APIReference/API_UserGroupResolutionConfiguration.html) 透過將 模式設定為 `AWS_SSO` 並呼叫 [UpdateIndex](https://docs.aws.amazon.com/kendra/latest/APIReference/API_UpdateIndex.html) 來更新您的索引以使用 IAM Identity Center 來設定 。

1. 如果您想要使用字符型使用者存取控制來篩選使用者內容的搜尋結果，請在呼叫 `USER_TOKEN`時將 [UserContextPolicy](https://docs.aws.amazon.com/kendra/latest/APIReference/API_UpdateIndex.html#Kendra-UpdateIndex-request-UserContextPolicy) 設定為 `UpdateIndex`。否則， 會為大多數資料來源連接器編 Amazon Kendra 目每個文件的存取控制清單。您也可以在 中提供使用者和群組資訊，以篩選[查詢](https://docs.aws.amazon.com/kendra/latest/APIReference/API_Query.html) API 中使用者內容的搜尋結果`UserContext`。您也可以使用 [PutPrincipalMapping](https://docs.aws.amazon.com/kendra/latest/APIReference/API_PutPrincipalMapping.html) 將使用者映射至其群組，以便在發出查詢時只需要提供使用者 ID。

1. 建立 [IAM 角色](https://docs.aws.amazon.com//kendra/latest/dg/iam-roles.html#iam-roles-ds)，提供存取資料來源的許可。

1. [設定](https://docs.aws.amazon.com/kendra/latest/APIReference/API_DataSourceConfiguration.html)您的資料來源。您必須提供必要的連線資訊，才能連線至資料來源。

1. 使用 [CreateDataSource](https://docs.aws.amazon.com/kendra/latest/APIReference/API_CreateDataSource.html) API 建立資料來源。提供 `DataSourceConfiguration` 物件，其中包含 `TemplateConfiguration`、索引的 ID、資料來源 IAM 的角色、資料來源類型，並為資料來源命名。您也可以更新資料來源。

# 變更 IAM Identity Center 身分來源
<a name="changing-aws-sso-source"></a>

**警告**  
在 IAM Identity Center **設定**中變更您的身分來源可能會影響使用者和群組資訊的保留。為了安全地執行此操作，建議您檢閱[變更身分來源的考量事項](https://docs.aws.amazon.com/singlesignon/latest/userguide/manage-your-identity-source-considerations.html)。當您變更身分來源時，會產生新的身分來源 ID。在 `AWS_SSO` [UserGroupResolutionConfiguration](https://docs.aws.amazon.com/kendra/latest/APIReference/API_UserGroupResolutionConfiguration.html) 中將模式設定為 之前，請檢查您使用的是正確的 ID。

**若要變更 IAM Identity Center 身分來源**

1. 開啟 [IAM Identity Center> 主控台](https://console.aws.amazon.com/singlesignon)。

1. 選擇**設定**。

1. 在**設定**頁面的**身分來源**下，選擇**變更**。

1. 在**變更身分來源**頁面上，選取您偏好的身分來源，然後選擇**下一步**。