I followed the mobile hub introductions to setup my AWSCognito in app, when I try to call the signing, as suggested by aws. It says Identity not found. The Identity is in the user pool I can see it in the backend also marked as verified. Why is this error given?
Code:
func handleLoginWithSignInProvider(signInProvider: AWSSignInProvider) {
AWSIdentityManager.defaultIdentityManager().loginWithSign(signInProvider, completionHandler:
{(result: Any?, error: Error?) -> Void in
if error == nil {
/* Handle successful login. */
print("success")
}
print("Login with signin provider result = \(result), error = \(error)")
})
}
The error:
GetCredentialsForIdentity failed. Error is [Error Domain=com.amazonaws.AWSCognitoIdentityErrorDomain Code=10 "(null)" UserInfo={__type=ResourceNotFoundException, message=Identity 'eu-west-1:xxxxxxx' not found.}] AWSiOSSDK v2.4.16 [Error] AWSCredentialsProvider.m line:577 | __44-[AWSCognitoCredentialsProvider credentials]_block_invoke.353 | Unable to refresh. Error is [Error Domain=com.amazonaws.AWSCognitoIdentityErrorDomain Code=10 "(null)" UserInfo={__type=ResourceNotFoundException, message=Identity 'eu-west-1:937fe0c4-974b-4f77-a835-425e1d9d9e00' not found.}] Login with signin provider result = nil, error = Optional(Error Domain=com.amazonaws.AWSCognitoIdentityErrorDomain Code=10 "(null)" UserInfo={__type=ResourceNotFoundException, message=Identity 'eu-west-1:xxxxxxxxx' not found.})
For others that is facing similar issue with JS, you can clear the content from the Developer Console in Application > Local Storage, find the Identity Pool UserID for the USER that is causing error and delete it from the storage.
Restart and try again. It should work.