Assume role with SAML

0

Hi, I'm trying to build an app that uses Azure AD as identity provider in conjunction with cognito. I wanted to use assume role with SAML to get the credentials but at the moment cognito returns tokens etc so I have to use assumeRoleWithWebIdentity and SAML assertion process happens in the background. How do I set it up in a way that I can actually get the SAML assertion back so I can pass it to the the assume role command. I cannot find a single example online of successful assumeRoleWithSAML implementation in javascript sdk

Many Thanks

1 Answer
0

Azure AD with AWS Cognito and use AssumeRole with SAML to get AWS credentials, you need to set up the federation between Azure AD and AWS Cognito. This process involves several steps:

  • Create an Amazon Cognito User Pool: This is your starting point where you will configure your user identities. You can do this from the AWS Management Console under the Amazon Cognito service.
  • Configure Azure AD as a SAML Identity Provider: In Azure AD, you need to set it up as a SAML identity provider. This will involve creating an enterprise application in Azure AD and configuring SAML settings such as the Identifier and Reply URL, which are specific to your Cognito User Pool.
  • Integrate Azure AD with AWS Cognito: You will need to add Azure AD as a SAML identity provider in your Cognito User Pool. This involves configuring SAML settings in Cognito and providing the metadata from Azure AD.
  • Retrieve SAML Assertion: The SAML assertion process typically happens in the background when a user authenticates via Azure AD. To manually retrieve the SAML assertion, you might need to intercept the SAML response from Azure AD during the authentication process. This step can be quite complex and might require custom development.
  • Use AssumeRoleWithWebIdentity: Once you have the SAML assertion, you can use the assumeRoleWithWebIdentity API call in the AWS JavaScript SDK. This call requires the SAML assertion as a parameter, along with the ARN of the role to assume and the ARN of the identity provider.
  • Handle Credentials: The assumeRoleWithWebIdentity call returns temporary security credentials, which you can then use to make authenticated requests to AWS services.
AWS
answered 6 months ago
profile picture
EXPERT
reviewed a month ago

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