Skip to content

AWS IAM Identity Center SAML Single Sign-On Example

This example uses AWS IAM Identity Center to let employees sign in to TrueWatch SaaS workspaces with their corporate identities. The AWS Global console is used as an example.

1. Prerequisites

Prepare SSO management permissions for the target workspace, application management permissions for the IAM Identity Center organization instance, and a directory user with a corporate email address configured. This example uses alice@example.com.

Open the IAM Identity Center console and switch to the AWS Region where the organization instance is located. Customer managed SAML 2.0 applications require an organization instance. If the SAML 2.0 option is not available when you create an application, first verify the instance type and Region. AWS instance type comparison

2. Create an Application in AWS and Download Metadata

  1. In IAM Identity Center > Applications > Customer managed, click Add application.
  2. Under Set preferences, select I have an application I want to set up, select SAML 2.0 as the application type, and click Next.
  3. Under Configure application, enter a display name, for example Guance SAML. Under IAM Identity Center metadata, click Download next to IAM Identity Center SAML metadata file.
  4. Keep this configuration page open. First complete Step 3 using the XML you just downloaded, then return to fill in Application metadata at the bottom of the page and submit. AWS customer managed SAML application configuration

3. Add an Identity Provider in TrueWatch

  1. In the target workspace, go to Management > Member Management > SSO Management > User SSO, select SAML, and click Add identity provider.
  2. Under Identity provider, enter AWS IAM Identity Center, and under Metadata document, upload the AWS metadata XML downloaded in the previous step.
  3. Under Mapping configuration, set both Email and Username to email, corresponding to the AWS attribute added in Step 4. Fill in Mobile number as needed. SAML field mapping
  4. Under Access restrictions, enter alice@example.com, select Role authorization, and confirm Session persistence, then save. For testing, you can select Read-only member and use the default duration.
  5. Click Edit for the identity provider, and download Metadata from Service provider details. If you plan to configure manually, also copy the Entity ID and Assertion URL. Obtain SP configuration

4. Enter the SP Configuration in AWS

  1. Return to the Configure application page in AWS. Under Application metadata, select Upload application SAML metadata file and upload the SP XML downloaded in Step 3. Alternatively, select Manually enter metadata values and fill them in according to the following table. When finished, click Submit.

    AWS field Value
    Application ACS URL The Assertion URL of TrueWatch
    Application SAML audience The Entity ID of TrueWatch
  2. On the application details page, go to Actions > Edit attribute mappings, modify Subject, and then add email via Add new attribute mapping. For both rows, use the IAM Identity Center user's email address as the value. When finished, click Save changes.

    Application attribute Mapped value Format
    Subject ${user:email} emailAddress
    email ${user:email} unspecified

    Subject is used to set the SAML NameID, and the email assertion attribute is used for email and username mapping in TrueWatch. AWS attribute mapping example

  3. If you need to authorize based on additional attributes, add these attributes to the AWS application, and then configure role mapping in TrueWatch. AWS SAML attribute mapping reference

5. Assign Access Permissions to Users and Groups

Prepare a Test User

Open the Users list in IAM Identity Center and confirm that the test user's Email address matches the access restriction entered in Step 3. If you are using the built-in directory and do not yet have a test account, click Add user, enter the username, email address, name, and display name, select a password setup method, and complete the creation. If you are using a synchronized directory, confirm that the user's corporate email address has been synchronized to IAM Identity Center. AWS instructions for adding users

Assign Users or Groups to the Application

  1. In IAM Identity Center > Applications, open the SAML application you just created.
  2. Under Assigned users, click Assign users, and search for and select the test user or the corresponding user group.
  3. Click Assign users to save. Return to TrueWatch and confirm that the identity provider is enabled. AWS instructions for assigning application access

6. Verify Sign-In

  1. Open the TrueWatch login page for the site in an incognito window, click Single sign-on, enter alice@example.com, and click Get login URL.
  2. Select AWS IAM Identity Center, click Authenticate/Sign in, and complete AWS authentication with the directory user assigned to the application.
  3. After returning to TrueWatch, go to the target workspace and verify the role. If AWS reports that the application has no access permission, check Assigned users. If you are prompted that the email address cannot be found after returning, confirm that email has been added to the application attribute mappings and that the user's email address has been entered. Login troubleshooting