Configure SAML federation for Amazon OpenSearch Serverless with AWS IAM Identity Center
Operationally, the important shift here is that authentication and authorization are split across three layers: IAM Identity Center issues the SAML assertion, OpenSearch Serverless trusts the provider metadata, and the data access policy decides what the authenticated identity can actually do. That separation is useful for governance, but it also means misalignment in any layer can block access or over-grant permissions.
The claim mapping is the real integration contract. In this pattern, the userโs email address becomes the durable identifier in the SAML principal, while optional group attributes can be projected into policy rules. That makes directory hygiene, naming consistency, and attribute stability operationally important. If identities are renamed or group structures drift, access policies may need to be updated to keep authorization deterministic.
There is also an architecture trade-off between user-centric and group-centric access control. Per-user rules can be straightforward for small environments, but they become harder to maintain as the number of consumers grows. Group-based rules reduce policy sprawl, yet they require disciplined lifecycle management in the identity source and careful control of group IDs so the OpenSearch policy continues to match the IdP output.
Finally, the session and cleanup settings have practical consequences for platform teams. The IAM Identity Center session duration takes precedence over the dashboard timeout, so authentication UX and re-login frequency are partly controlled outside OpenSearch. And because the provider, access policy, and collection are separate resources, lifecycle automation matters: environment teardown, change management, and least-privilege reviews should all be treated as part of the deployment workflow.
AWS IAM Identity Centerย (Successor to AWS Single Sign-On) helps you securely create or connect your workforce identities and manage their access centrally across AWS accounts and applications, OpenSearch Dashboards being one of them.
In this post, we show you how to configure SAML authentication for OpenSearch Dashboards using IAM Identity Center as its IdP.
Solution overview
The following diagram illustrates how the solution allows users or groups to authenticate into OpenSearch Dashboards using single sign-on (SSO) with IAM Identity Center using its built-in directory as the identity source.

The workflow steps are as follows:
- A user accesses the OpenSearch Dashboard URL in their browser and chooses the SAML provider.
- OpenSearch Serverless redirects the login to the specified IdP.
- The IdP provides a login form for the user to specify the credentials for authentication.
- After the user is authenticated successfully, a SAML assertion is sent back to OpenSearch Serverless.
OpenSearch Serverless validates the SAML assertion, and the user logs in to OpenSearch Dashboards.
Prerequisites
To get started, you must have an active OpenSearch Serverless collection. Refer toย Creating and managing Amazon OpenSearch Serverless collectionsย to learn more about creating a collection. Furthermore, you must have the correctย AWS Identity and Access Managementย (IAM) permissions for configuringย SAML authenticationย along with relevant IAM permissions for configuring theย data access policy.
IAM Identity Center should be enabled, and you should have the relevant IAM permissions to create an application in IAM Identity Center and create and manage users and groups.
Create and configure the application in IAM Identity Center
To set up your application in IAM Identity Center, complete the following steps:
- On the IAM Identity Center dashboard, chooseย Applicationsย in the navigation pane.
- Chooseย Add application
ยย - Forย Custom application, selectย Add custom SAML 2.0 application.
- Chooseย Next.
ยย - Underย Configure application, enter a name and description for the application.
- Underย IAM Identity Center metadata, chooseย Downloadย underย IAM Identity Center SAML metadata file.
ยย
We use this metadata file to create a SAML provider under OpenSearch Serverless. It contains the public certificate used to verify the signature of the IAM Identity Center SAML assertions.
- Underย Application properties, leaveย Application start URLย andย Relay stateย blank.
- Forย Session duration, chooseย 1 hourย (the default value).
ยย
Note that the session duration you configure in this step takes precedence over the OpenSearch Dashboards timeout setting specified in the configuration of the SAML provider details on the OpenSearch Serverless end.
- Underย Application metadata, selectย Manually type your metadata values.
- Forย Application ACS URL, enter your URL using the formatย
https://collection.<REGION>.aoss.amazonaws.com/_saml/acs. For example, we enterยhttps://collection.us-east-1.aoss.amazonaws.com/_saml/acsย for this post. - Forย Application SAML audience, enter your service provider in the formatย
aws:opensearch:<aws account id>.
ยย - Chooseย Submit.
Now you modify the attribute settings. Theย attribute mappingsย you configure here become part of the SAML assertion that is sent to the application.
- On theย Actionsย menu, chooseย Edit attribute mappings.
ยย - Configure Subject to map toย
${user:email}, with the formatย unspecified.
Usingย ${user:email}ย here ensures that the email address for the user in IAM Identity Center is passed in theย <NameId>ย tag of the SAML response.
- Chooseย Save changes.
ยย
Now we assign a user to the application.
- Create a userย in IAM Identity Center to use to log in to OpenSearch Dashboards.
Alternatively, you can use an existing user.
- On the IAM Identity Center console, navigate to your application and chooseย Assign Usersย and select the user(s) you would like to assign.
ยย
You have now created a custom SAML application. Next, you will configure the SAML provider in OpenSearch Serverless.
Create a SAML provider
The SAML provider you create in this step can be assigned to any collection in the same Region. Complete the following steps:
- On the OpenSearch Service console, underย Serverlessย in the navigation pane, chooseย SAML authenticationย underย Security.
- Chooseย Create SAML provider.
ยย - Enter a name and description for your SAML provider.
- Enter the metadata from your IdP that you downloaded earlier.
ยย - Underย Additional settings, you can optionally add custom user ID and group attributes. We leave these settings blank for now.
- Chooseย Create a SAML provider.
ยย
You have now configured a SAML provider for OpenSearch Serverless. Next, we walk you through configuring the data access policy for accessing collections.
Create the data access policy
In this section, you set up data access policies for OpenSearch Serverless and allow access to the users. Complete the following steps:
- On the OpenSearch Service console, underย Serverlessย in the navigation pane, chooseย Data access policiesย underย Security.
- Chooseย Create access policy.
ยย - Enter a name and description for your access policy.
- Forย Policy definition method, selectย Visual Editor.
- In theย Rulesย section, enter a rule name.
- Underย Select principals, forย Add principals, chooseย SAML users and groups.
ยย - Forย SAML provider name, choose the SAML provider you created earlier.
ยย - Specify the user in the formatย
user/<email>ย (for example,ยuser/[email protected]).
The value of the email address should match the email address in IAM Identity Center.
- Chooseย Save.
- Chooseย Grantย and specify the permissions.
You can configure what access you want to provide for the specific user at the collection level and specific indexes at the index pattern level.
You should select the access the user needs based on the least privilege model. Refer toย Supported policy permissionsย andย Supported OpenSearch API operations and permissionsย to set up more granular access for your users.
- Chooseย Saveย and configure any additional rules, if required.
ยย
You can now review and edit your configuration if needed.
- Chooseย Createย to create the data access policy.
ยย
Now you have the data access policy that will allow the users to perform the allowed actions on OpenSearch Dashboards.
Access OpenSearch Dashboards
To sign in to OpenSearch Dashboards, complete the following steps:
- On the OpenSearch Service dashboard, underย Serverlessย in the navigation pane, chooseย Dashboard.
- Locate your dashboard and copy the OpenSearch Dashboards URL (in the formatย
<collection-endpoint>/_dashboards).
ยย - Enter this URL into a new browser tab.
- On the OpenSearch login page, choose your IdP and specify your SSO credentials.
- Chooseย Login.
ยย
Configure SAML authentication using groups in IAM Identity Center
Groups can help you organize your users and permissions in a coherent way. With groups, you can add multiple users from the IdP, and then useย groupidย as the identifier in the data access policy. For more information, refer toย Add groupsย andย Add users to groups.
To configure group access to OpenSearch Dashboards, complete the following steps:
- On the IAM Identity Center console, navigate to your application.
- In theย Attribute mappingsย section, add an additional user as group and map it toย
${user:groups}, with the formatย unspecified. - Chooseย Save changes.
ยย - For the SAML provider in OpenSearch Serverless, underย Additionalย settings, forย Group attribute, enter group.
ยย - For the data access policy, create a new rule or add an additional principal in the previous rule.
- Choose the SAML provider name and enterย
group/<GroupId>.
ยย
You can fetch the value for the group ID by navigating to theย Groupย section on the IAM Identity Center console.
Clean up
If you donโt want to continue using the solution, be sure to delete the resources you created:
- On the IAM Identity Center console,ย remove the application.
- On OpenSearch Dashboards, delete the following resources:
Conclusion
In this post, you learned how to set up IAM Identity Center as an IdP to access OpenSearch Dashboards using SAML as SSO. You also learned on how to set up users and groups within IAM Identity Center and control the access of users and groups for OpenSearch Dashboards. For more details, refer toย SAML authentication for Amazon OpenSearch Serverless.
Stay tuned for a series of posts focusing on the various options available for you to build effective log analytics and search solutions using OpenSearch Serverless. You can also refer to theย Getting started with Amazon OpenSearch Serverlessย workshop to know more about OpenSearch Serverless.
If you have feedback about this post, submit it in the comments section. If you have questions about this post, start a new thread on theย OpenSearch Service forumย orย contact AWS Support.
About the Authors
Utkarsh Agarwal is a Cloud Support Engineer in the Support Engineering team at Amazon Web Services. He specializes in Amazon OpenSearch Service. He provides guidance and technical assistance to customers thus enabling them to build scalable, highly available and secure solutions in AWS Cloud. In his free time, he enjoys watching movies, TV series and of course cricket! Lately, he his also attempting to master the art of cooking in his free time โ The taste buds are excited, but the kitchen might disagree.
Ravi Bhataneย is a software engineer with Amazon OpenSearch Serverless Service. He is passionate about security, distributed systems, and building scalable services. When heโs not coding, Ravi enjoys photography and exploring new hiking trails with his friends.
Prashant Agrawal is a Sr. Search Specialist Solutions Architect with Amazon OpenSearch Service. He works closely with customers to help them migrate their workloads to the cloud and helps existing customers fine-tune their clusters to achieve better performance and save on cost. Before joining AWS, he helped various customers use OpenSearch and Elasticsearch for their search and log analytics use cases. When not working, you can find him traveling and exploring new places. In short, he likes doing Eat โ Travel โ Repeat.
ย
Building SAML federation for Amazon OpenSearch Dashboards with Auth0
Enjoyed this article? Sign up for our newsletter to receive regular insights and stay connected.





















