- Newest
- Most votes
- Most comments
The issue you're experiencing with the UserNotFoundException when calling the Amazon Connect GetFederationToken() API is likely related to a mismatch between the user identifiers in Amazon Connect and the federated identity from Cognito.
When using federated authentication with Amazon Connect, it's important to ensure that the user identifiers align across your identity provider, Cognito, and Amazon Connect. The fact that Cognito is automatically creating usernames in the format <external-provider-name>_<username> could indeed be causing this issue.
Amazon Connect expects to find a user that matches the federated identity. If the username in Amazon Connect doesn't match the identifier coming from Cognito, you'll encounter the UserNotFoundException.
To resolve this, you have a few options:
-
Modify your Amazon Connect user creation process to match the Cognito username format. This means creating users in Amazon Connect with the <external-provider-name>_<username> format.
-
Configure your Cognito User Pool to use a different attribute as the username, such as email. This can be done when setting up the User Pool by specifying email as an alias attribute.
-
If possible, customize the federation process to pass the correct identifier to Amazon Connect that matches the username you've set up in the Connect instance.
-
Review your SAML configuration to ensure that the correct user identifier is being passed through the federation process.
It's also worth noting that while Cognito can be used for federation with Amazon Connect, many implementations use IAM Identity Center (formerly AWS SSO) directly for this purpose, especially in enterprise scenarios. IAM Identity Center provides a more streamlined experience for SAML-based federation with Amazon Connect.
If you continue to face issues, you may want to review your entire authentication flow, ensuring that the user identifiers are consistent across all services involved in the federation process.
Sources
GetFederationToken - Amazon Connect
How to implement trusted identity propagation for applications protected by Amazon Cognito | AWS Security Blog
Amazon WorkSpaces Secure Browser FAQs – Amazon Web Services
answered a year ago
Relevant content
asked 3 years ago
- AWS OFFICIALUpdated 3 months ago

I tried adding the cognito username format to amazon connect too, still no luck. I am again getting user not found error. What values does get cross matched when this GetFederationToken() is called?