Implement SAML 2.0 authentication for Amazon WorkSpaces by using Auth0 and AWS Managed Microsoft AD
Siva Vinnakota and Shantanu Padhye, Amazon Web Services
Summary
This pattern explores how you can integrate Auth0 with AWS Directory Service for Microsoft Active Directory to create a robust SAML 2.0 authentication solution for your Amazon WorkSpaces environment. It explains how to establish federation between these AWS services to enable advanced features such as multi-factor authentication (MFA) and custom login flows while preserving seamless desktop access through AWS Managed Microsoft AD. Whether you're managing only a handful of users or thousands, this integration helps provide flexibility and security for your organization. This pattern provides the steps for the setup process so you can implement this solution in your own environment.
Prerequisites and limitations
Prerequisites
An active AWS account
AWS Managed Microsoft AD
A provisioned desktop in Amazon WorkSpaces Personal that is associated with AWS Managed Microsoft AD
An Amazon Elastic Compute Cloud (Amazon EC2) instance
An Auth0 account
Limitations
Some AWS services aren’t available in all AWS Regions. For Region availability, see AWS services by Region
Architecture
The SAML 2.0 authentication process for a WorkSpaces client application consists of five steps that are illustrated in the following diagram. These steps represent a typical workflow for logging in. You can use this distributed approach to authentication after you follow the instructions in this pattern, to help provide a structured and secure method for user access.

Workflow:
Registration. The user launches the client application for WorkSpaces and enters the WorkSpaces registration code for their SAML-enabled WorkSpaces directory. WorkSpaces returns the Auth0 identity provider (IdP) URL to the client application.
Login. The WorkSpaces client redirects to the user’s web browser by using the Auth0 URL. The user authenticates with their username and password. Auth0 returns a SAML assertion to the client browser. The SAML assertion is an encrypted token that asserts the user’s identity.
Authenticate. The client browser posts the SAML assertion to the AWS Sign-In endpoint to validate it. AWS Sign-In allows the caller to assume an AWS Identity and Access Management (IAM) role. This returns a token that contains temporary credentials for the IAM role.
WorkSpaces login. The WorkSpaces client presents the token to the WorkSpaces service endpoint. WorkSpaces exchanges the token for a session token and returns the session token to the WorkSpaces client with a login URL. When the WorkSpaces client loads the login page. the username value is populated by the
NameId
value that’s passed in the SAML response.Streaming. The user enters their password and authenticates against the WorkSpaces directory. After authentication, WorkSpaces returns a token to the client. The client redirects back to the WorkSpaces service and presents the token. This brokers a streaming session between the WorkSpaces client and the WorkSpace.
Note
To set up a seamless single sign-on experience that doesn’t require a password prompt, see the Certificate-based authentication and WorkSpaces Personal in the WorkSpaces documentation.
Tools
AWS services
Amazon WorkSpaces is a fully managed virtual desktop infrastructure (VDI) service that provides users with cloud-based desktops without having to procure and deploy hardware or install complex software.
AWS Directory Service for Microsoft Active Directory enables your directory-aware workloads and AWS resources to use Microsoft Active Directory in the AWS Cloud.
Other tools
Auth0
is an authentication and authorization platform that helps you manage access to your applications.
Epics
Task | Description | Skills required |
---|---|---|
Install the Active Directory LDAP connector in Auth0 with AWS Managed Microsoft AD. |
| Cloud administrator, Cloud architect |
Create an application in Auth0 to generate the SAML metadata manifest file. |
| Cloud administrator, Cloud architect |
Task | Description | Skills required |
---|---|---|
Create a SAML 2.0 IdP in IAM. | To set up SAML 2.0 as an IdP, follow the steps that are outlined in Create a SAML identity provider in IAM in the IAM documentation. | Cloud administrator |
Create an IAM role and policy for SAML 2.0 federation. |
| Cloud administrator |
Task | Description | Skills required |
---|---|---|
Configure Auth0 and SAML assertions. | You can use Auth0 actions to configure assertions in SAML 2.0 responses. A SAML assertion is an encrypted token that asserts the user’s identity.
This completes the setup of SAML 2.0 authentication for WorkSpaces Personal desktops. The Architecture section illustrates the authentication process after setup. | Cloud administrator |
Troubleshooting
Issue | Solution |
---|---|
SAML 2.0 authentication issues in WorkSpaces
| If you encounter any issues when you implement SAML 2.0 authentication for WorkSpaces Personal, follow the steps and links outlined in the AWS re:Post article For additional information about investigating SAML 2.0 errors while accessing WorkSpaces, see:
|
Related resources
Set up SAML 2.0 for WorkSpaces Personal (WorkSpaces documentation)