Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Get Dashboard URL Using Enhanced Authentication Flow and Token Role Mapping #12

@jra85

Description

@jra85

Hi, I'm working to embed a dashboard in an application that utilizes a Cognito User Pool as its federated identity provider, and to further control access to AWS resources, those users are assigned to Cognito groups that are associated with a Role. This setup requires that the identity pool's Authenticated Role Selection is set to "Choose Role From Token". However, when I attempt to get the Open ID token in my web application using the CognitoIdentity.getOpenIdToken API from the AWS SDK, the following error occurs: "Basic (classic) flow is not supported with RoleMappings, please use enhanced flow."

I did attempt modifying the embedding sample's OpenID Lambda script to leverage the ID token that's provided by Cognito (rather than the Open ID token) and calling CognitoIdentity.getCredentialsForIdentity rather than STS.assumeRoleWithWebIdentity to obtain the access keys to use with QuickSight, but upon executing the Lambda I get the error "QuickSightUserNotFoundException: Could not find user information in QuickSight". I don't have insight into what username it's actually looking for though to know how to correct my approach. Perhaps since the script is no longer using assumeRoleWithWebIdentity the role name is not prefixed to the username?

The "Allow Basic (Classic) Flow" option is enabled for the identity pool, but that does not resolve it. It does seem that this option needs to be enabled for the Lambda example to work as it is, but I use the enhanced flow everywhere else in my application, so being able to embed the dashboard without requiring the basic flow to be enabled would be ideal.

Any insight is appreciated as I'd really prefer to continue using the enhanced flow and token-based role mapping with this application.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions