I have created one user pool & identity pool.
I have used javascript sdk.
I am able to signup, send confirmation code & confirm user successfully with j
When you create role in IAM and choose identity provider, make sure you don't choose user pool id, instead, you have to choose identity pool id.
IAM