Cognito User access to Embedded Quicksight dashboard


I have a Cognito user login to access embedded Quicksight dashboard to Amplify Web app, but it requests for a second login to QS before I can view the dashboard.
How do I setup, so a client user only needs to use the Cognito login details to directly access the embedded Quicksight dashboard without having to register another QS account for the same user. Thanks in Advance

1 Answer
Accepted Answer

A straightforward integration is currently not available between Quicksight and Cognito. Let us discuss the possible two approaches for your requirement :

Approach 1:

The following resources would get created in the setup of integration between Quicksight and Cognito:

  • Amazon CloudFront distribution
  • S3 static website
  • Amazon Cognito user pool
  • Amazon Cognito identity pool
  • IAM role for authenticated users
  • API Gateway API
  • Lambda function

I would kindly request you to refer to the following link for using QuickSight federated SSO with Amazon Cognito user pools : [+]

Generally, the architecture in the above link uses an ID token generated by Amazon Cognito to call API Gateway and Lambda to obtain a sign-in token for Amazon QuickSight from AWS Sign-In Federation. With this token, the app redirects access to Amazon QuickSight.

A web app hosted on Amazon S3 integrates with Amazon Cognito User Pools to authenticate users. It uses Amazon Cognito Federated Identities to authorize access to Amazon QuickSight on behalf of the authenticated user, with temporary AWS credentials and appropriate permissions.

And you can also use the below Github link for a simple JavaScript frontend and SAM template to spin up a serverless backend, federating Amazon Cognito User Pools users to QuickSight :


Approach 2 : 
 The use case you are trying to achieve will require usage of both Cognito user pool and identity pool. The user flow will look as below.

  1. The user gets authenticated by Cognito User pool with SAML based IdP associated with your Active Directory.
  2. The User is provided with the id, access and refresh token.
  3. The User uses the ID token issued by user pool to get the identity ID for the user using the GetId API call.
  4. Now the identity ID and ID token can be used to get AWS credentials using the GetCredentialsForIdentity API call.
  5. User uses the AWS credentials to access QuickSight.

To achieve the above flow the following steps needs to be performed -


  • Create a user pool in Cognito using the management console - . Please refer [1] for detailed steps.

  • Integrate the user pool with the SAML IdP(AWS SSO, ADFS, Okta, which ever you are using) which is associated with your Active Directory. Please refer [2][3] for how to setup a SAML IdP in user pool.

  • Configure a User Pool App Client [4] and configure a User Pool Domain[5].

  • Change app client settings in Amazon Cognito user pool-

    • Under Enabled identity providers, select the check box for the SAML IdP you configured. For example, ADFS.
    • For Callback URL(s), enter a URL where you want your users to be redirected after logging in.
    • For Sign out URL(s), enter a URL where you want your users to be redirected after logging out.
    • Under Allowed OAuth Flows and Allowed OAuth Scopes, select according to your requirement.
    • Click the Launch Hosted UI button and login/sign up to the user pool using the “Login with SAML” option.
  • After successful login in the user will be provided with the id, access and refresh token.


  • Create an Identity Pool in Cognito using the management console. Please refer [6] for detailed steps.

    • While creation of the identity pool provide the associated role with appropriate QuickSight Permission. IAM identity Based Policy for Amazon QuickSight dashboards is referenced in [7].
    • Also make sure to give sts:AssumeRoleWithWebIdentity [8]permission to the role. Here AssuemRoleWithWebIdentity permission is granted to get a set of temporary security credentials for user. We are using “WebIdentity” since the user has been authenticated by Cognito.
  • Enable Cognito user pool as authentication provider for the identity pool. Please refer [9] for detailed steps.


  • Use the ID token issued by the user pool to make the GetId API[10] call which will generate an IdentityID.


  • Use the Identity ID and the ID token to get AWS credentials(Access key and secret access key) using the GetCredentialsForIdentity API[11] call.

  • These credentials can be used by the user to access QuickSight dashboard.


[1] Creating a User Pool -
[2] Creating and Managing a SAML Identity Provider for a User Pool -
[3] set up ADFS as a SAML identity provider with an Amazon Cognito user pool -
[4] Configuring a User Pool App Client - [5] Configuring a User Pool Domain - [6] Creating an Identity Pool -
[7] IAM Identity Based Policies for Amazon QuickSight: Dashboards -
[8] AssumeRoleWithWebIdentity - [9] Enable User pool as provider for identity pool -
[10] GetId - [11] GetCredentialsForIdentity -

answered 5 months ago
profile picture
reviewed a month ago
profile picture
reviewed 2 months ago
  • Thank you very much.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions