

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

# 最終使用者運算
<a name="endusercomputing-pattern-list"></a>

**Topics**
+ [使用 Auth0 和 實作 Amazon WorkSpaces 的 SAML 2.Auth0驗證 AWS Managed Microsoft AD](implement-saml-authentication-for-amazon-workspaces-by-using-auth0-and-aws-managed-microsoft-ad.md)
+ [更多模式](endusercomputing-more-patterns-pattern-list.md)

# 使用 Auth0 和 實作 Amazon WorkSpaces 的 SAML 2.Auth0驗證 AWS Managed Microsoft AD
<a name="implement-saml-authentication-for-amazon-workspaces-by-using-auth0-and-aws-managed-microsoft-ad"></a>

*Siva Vinnakota 和 Shantanu Padhye，Amazon Web Services*

## 總結
<a name="implement-saml-authentication-for-amazon-workspaces-by-using-auth0-and-aws-managed-microsoft-ad-summary"></a>

此模式會探索如何將 Auth0 與 整合 AWS Directory Service for Microsoft Active Directory ，為您的 Amazon WorkSpaces 環境建立強大的 SAML 2.0 身分驗證解決方案。它說明如何在這些項目之間建立聯合 AWS 服務 ，以啟用多重要素驗證 (MFA) 和自訂登入流程等進階功能，同時保留無縫桌面存取 AWS Managed Microsoft AD。無論您是只管理少數使用者還是數千個使用者，此整合都有助於為您的組織提供靈活性和安全性。此模式提供設定程序的步驟，讓您可以在自己的環境中實作此解決方案。

## 先決條件和限制
<a name="implement-saml-authentication-for-amazon-workspaces-by-using-auth0-and-aws-managed-microsoft-ad-prereqs"></a>

**先決條件 **
+ 作用中 AWS 帳戶
+ AWS Managed Microsoft AD
+ Amazon WorkSpaces Personal 中與 相關聯的佈建桌面 AWS Managed Microsoft AD
+ Amazon Elastic Compute Cloud (Amazon EC2) 執行個體
+ Auth0 帳戶

**限制**

有些 AWS 服務 完全無法使用 AWS 區域。如需區域可用性，請參閱[AWS 服務 依區域](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/)。如需特定端點，請參閱[服務端點和配額](https://docs.aws.amazon.com/general/latest/gr/aws-service-information.html)頁面，然後選擇服務的連結。

## Architecture
<a name="implement-saml-authentication-for-amazon-workspaces-by-using-auth0-and-aws-managed-microsoft-ad-architecture"></a>

WorkSpaces 用戶端應用程式的 SAML 2.0 身分驗證程序包含五個步驟，如下圖所示。這些步驟代表用於登入的典型工作流程。您可以在遵循此模式中的指示後，使用此分散式方法進行身分驗證，以協助提供結構化且安全的使用者存取方法。

![\[WorkSpaces 用戶端應用程式的 SAML 2.0 身分驗證程序工作流程。\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/images/pattern-img/5a0f227c-c111-495b-9fde-98ae7832bb10/images/957b2a11-e898-4c4f-ae4e-c2e85bfa93a0.png)


 工作流程：

1. **註冊**。使用者啟動 WorkSpaces 的用戶端應用程式，並為其已啟用 SAML 的 WorkSpaces 目錄輸入 WorkSpaces 註冊碼。WorkSpaces 會將 Auth0 身分提供者 (IdP) URL 傳回至用戶端應用程式。

1. **登入。 **WorkSpaces 用戶端會使用 Auth0 URL 重新導向至使用者的 Web 瀏覽器。 使用者使用其使用者名稱和密碼進行身分驗證。Auth0 會將 SAML 聲明傳回至用戶端瀏覽器。SAML 聲明是可宣告使用者身分的加密字符。

1. **驗證**。用戶端瀏覽器會將 SAML 聲明發佈至 AWS 登入 端點以進行驗證。 AWS 登入 允許發起人擔任 AWS Identity and Access Management (IAM) 角色。這會傳回包含 IAM 角色臨時登入資料的字符。

1. **WorkSpaces 登入**。WorkSpaces 用戶端會將權杖呈現給 WorkSpaces 服務端點。WorkSpaces 會交換工作階段字符，並使用登入 URL 將工作階段字符傳回給 WorkSpaces 用戶端。當 WorkSpaces 用戶端載入登入頁面時，使用者名稱值會填入在 SAML 回應中傳遞`NameId`的值。

1. **串流**。使用者輸入其密碼並對 WorkSpaces 目錄進行身分驗證。身分驗證之後，WorkSpaces 會將權杖傳回給用戶端。用戶端會重新導向回 WorkSpaces 服務，並呈現權杖。這會代理 WorkSpaces 用戶端和 WorkSpace 之間的串流工作階段。

**注意**  
若要設定不需要密碼提示的無縫單一登入體驗，請參閱 [ WorkSpaces 文件中的憑證型身分驗證和 WorkSpaces Personal](https://docs.aws.amazon.com/workspaces/latest/adminguide/certificate-based-authentication.html)。 WorkSpaces 

## 工具
<a name="implement-saml-authentication-for-amazon-workspaces-by-using-auth0-and-aws-managed-microsoft-ad-tools"></a>

**AWS 服務**
+ [Amazon WorkSpaces](https://docs.aws.amazon.com/workspaces/latest/adminguide/amazon-workspaces.html) 是一項全受管的虛擬桌面基礎設施 (VDI) 服務，為使用者提供雲端型桌面，而無需購買和部署硬體或安裝複雜的軟體。
+ [AWS Directory Service for Microsoft Active Directory](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/directory_microsoft_ad.html) 可讓您的目錄感知工作負載 AWS 和資源在 中使用 Microsoft Active Directory AWS 雲端。

**其他工具**
+ [Auth0](https://auth0.com/) 是一種身分驗證和授權平台，可協助您管理對應用程式的存取。

## 史詩
<a name="implement-saml-authentication-for-amazon-workspaces-by-using-auth0-and-aws-managed-microsoft-ad-epics"></a>

### 在 Auth0 中設定 Active Directory LDAP 連接器
<a name="configure-the-active-directory-ldap-connector-in-auth0"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 使用 在 Auth0 中安裝 Active Directory LDAP 連接器 AWS Managed Microsoft AD。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/implement-saml-authentication-for-amazon-workspaces-by-using-auth0-and-aws-managed-microsoft-ad.html) | 雲端管理員、雲端架構師 | 
| 在 Auth0 中建立應用程式，以產生 SAML 中繼資料清單檔案。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/implement-saml-authentication-for-amazon-workspaces-by-using-auth0-and-aws-managed-microsoft-ad.html) | 雲端管理員、雲端架構師 | 

### 在 IAM 中設定 SAML 2.0 的 IdP、角色和政策
<a name="set-up-idp-role-and-policy-for-saml-2-0-in-iam"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 在 IAM 中建立 SAML 2.0 IdP。 | 若要將 SAML 2.0 設定為 IdP，請遵循 IAM 文件中在 [IAM 中建立 SAML 身分提供者](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html)中所述的步驟。 | 雲端管理員 | 
| 建立 SAML 2.0 聯合的 IAM 角色和政策。 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/implement-saml-authentication-for-amazon-workspaces-by-using-auth0-and-aws-managed-microsoft-ad.html) | 雲端管理員 | 

### 在 Auth0 中設定宣告
<a name="configure-assertions-in-auth0"></a>


| 任務 | Description | 所需的技能 | 
| --- | --- | --- | 
| 設定 Auth0 和 SAML 聲明。 | 您可以使用 Auth0 動作在 SAML 2.0 回應中設定宣告。SAML 聲明是可宣告使用者身分的加密字符。[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/implement-saml-authentication-for-amazon-workspaces-by-using-auth0-and-aws-managed-microsoft-ad.html)如此即完成 WorkSpaces Personal 桌面的 SAML 2.0 身分驗證設定。[架構](#implement-saml-authentication-for-amazon-workspaces-by-using-auth0-and-aws-managed-microsoft-ad-architecture)區段說明設定後的身分驗證程序。 | 雲端管理員 | 

## 疑難排解
<a name="implement-saml-authentication-for-amazon-workspaces-by-using-auth0-and-aws-managed-microsoft-ad-troubleshooting"></a>


| 問題 | 解決方案 | 
| --- | --- | 
| WorkSpaces 中的 SAML 2.0 身分驗證問題** ** | 如果您在實作 WorkSpaces Personal 的 SAML 2.0 身分驗證時遇到任何問題，請遵循 [AWS re：Post 文章](https://repost.aws/knowledge-center/workspaces-saml-authentication-issues)中關於對 SAML 2.0 身分驗證進行疑難排解的步驟和連結。如需有關在存取 WorkSpaces 時調查 SAML 2.0 錯誤的其他資訊，請參閱：[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/prescriptive-guidance/latest/patterns/implement-saml-authentication-for-amazon-workspaces-by-using-auth0-and-aws-managed-microsoft-ad.html) | 

## 相關資源
<a name="implement-saml-authentication-for-amazon-workspaces-by-using-auth0-and-aws-managed-microsoft-ad-resources"></a>
+ [為 WorkSpaces Personal 設定 SAML 2.0](https://docs.aws.amazon.com/workspaces/latest/adminguide/setting-up-saml.html) (WorkSpaces 文件）
+ [Auth0 文件](https://auth0.com/docs)

# 更多模式
<a name="endusercomputing-more-patterns-pattern-list"></a>

**Topics**
+ [使用 自動建立 Amazon WorkSpaces 應用程式資源 AWS CloudFormation](automate-the-creation-of-appstream-2-0-resources-using-aws-cloudformation.md)
+ [改善 Amazon Connect 聯絡中心中客服人員工作站的通話品質](improve-call-quality-on-agent-workstations-in-amazon-connect-contact-centers.md)
+ [從 AWS Step Functions 同步執行 AWS Systems Manager 自動化任務 AWS Step Functions](run-aws-systems-manager-automation-tasks-synchronously-from-aws-step-functions.md)