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
I have had similar error, resolved it by adding the below in the trust policy
Note: You should include sts:TagSession in the IAM role’s trust policy before enabling this feature.