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.})
By 'I can see it in the backend', do you mean in the Cognito identity browser? I took the identity id from your message and I can't find it stored in the Cognito data store. How are you verifying that it exists?
Try to clear your credentials provider and try again, some weird metadata may have gotten stuck inside.