Reputation: 190
I will want to use Okta as SAML 2.0 based IDP, AWS Cognito as service provider, and Cognito user pool to have federated IDP configuration.
I have followed all the steps mentioned in AWS sites listed below -
Okta does not provide any support or documentation - https://support.okta.com/help/answers?id=9062A000000QucAQAS&feedtype=SINGLE_QUESTION_DETAIL&dc=xSAML&criteria=OPENQUESTIONS& .
Please note that I have tried Okta as IDP, established trust with AWS IAM, and using Okta user logs in to my AWS account. This works fine following the detailed documentation provided by Okta. However, my need is different wherein I would like to use Okta as SAML IDP in my AWS cognito user pool.
Any detailed documentation containing configurations to be done at both ends i.e. AWS and Okta, will be helpful.
Upvotes: 7
Views: 8740
Reputation: 186
I did setup Okta with Cognito through SAML with the following:
Okta side:
https://<yourDomainPrefix>.auth.<region>.amazoncognito.com/saml2/idpresponse
(see under your user pool, "App integration" -> "Domain name" for the first part of the URL).urn:amazon:cognito:sp:<yourUserPoolID>
(see your user pool "General Settings" for that pool ID).Cognito side - User pool:
Cognito side - Identity pool:
That should be about it. Resources that were of help: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-saml-idp.html
EDIT: It seems that clarification was required on the Audience URI/Audience Restriction Okta setting. As Julien below mentioned is in the form of urn:amazon:cognito:sp:region_randomid (ie. urn:amazon:cognito:sp:eu-west-1_SdsSdwSD3e), you don't need to add yourself the region.
Upvotes: 7
Reputation: 31
Disclaimer: I'm not a SAML expert
We had to face the same problem here. After authentication in Okta we were redirected to the Cognito login screen. I tried to follow the advice from WenWolf with no success.
I analyzed the SAML flow using the SAML-tracer extension in Firefox. An error message was hidden in the redirect URI after the assertion POST.
Which gives you :
Error in SAML response processing: Audience restriction in SAML Assertion does now allow it for urn:amazon:cognito:sp:eu-west-1_YYYYYYYY
To fix it in Okta:
urn:amazon:cognito:sp:IDFoundInAppIntegrationAppClientSettings
urn:amazon:cognito:sp:eu-west-1_YYYYYYYY
This ID also appear in the auto-generated group in Cognito General settings>Users and groups
PS: Keep the other advices on NameId and required attribute mapping that needs to be consistent on both side.
Upvotes: 3