Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS - Cognito Federated identities

I have created a federated identities which contains:

  1. Identity pool ID us-west-2:XXXX-XXXXXXX-XXXX-XXXX-XXXX
  2. User Pool ID us-west-2_XXXXXXXXX
  3. App client ID XXXXXX

When I try with Identity pool ID to connect to: https://cognito-idp.us-west-2.amazonaws.com/us-west-2:XXXX-XXXXXXX-XXXX-XXXX-XXXX/.well-known/jwks.json

I get:

{"message":"1 validation error detected: Value 'us-west-2:XXXX-XXXXXXX-XXXX-XXXX-XXXX' at 'userPoolId' failed to satisfy constraint: Member must satisfy regular expression pattern: [\\w-]+_[0-9a-zA-Z]+"}

If I try with User Pool ID us-west-2_XXXXXXXXX https://cognito-idp.us-west-2.amazonaws.com/us-west-2_xxxxxxxxxxxxxxx/.well-known/jwks.json

{"message":"User pool us-west-2_ does not exist."}

How can I fix this?

like image 483
lgndrzzz Avatar asked Oct 14 '22 23:10

lgndrzzz


1 Answers

The identity pool id does not feature in the path, it is the user pool only https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/jwks.json, as shown here.

https://cognito-idp.us-west-2.amazonaws.com/us-west-2_XXXXXXXXX/.well-known/jwks.json

like image 147
Derrops Avatar answered Oct 18 '22 12:10

Derrops