I decided that using the code below, obviously, there is no need to provide IdentityPoolId in this example at all, it's just placeholders that can be left below:
AWS.config.region = 'us-east-1'; // Region AWS.config.credentials = new AWS.CognitoIdentityCredentials({ IdentityPoolId: '...' }); AWSCognito.config.region = 'us-east-1'; AWSCognito.config.credentials = new AWS.CognitoIdentityCredentials({ IdentityPoolId: '...' });
Both the credentials AWS.config.credentials and AWSCognito.config.credentials must be set. After completing the above steps, AWSCognito.config needs to be updated as shown below:
// Need to provide placeholder keys unless unauthorised user access is enabled for user pool AWSCognito.config.update({accessKeyId: 'anything', secretAccessKey: 'anything'}) var poolData = { UserPoolId : 'user pool id collected from user pool', ClientId : 'application client id of app subscribed to user pool' };
dataPhoneNumber and userData are optional, dataPhoneNumber should be provided if necessary to check sms for registration.
The problem was solved after the above was in place, Identity-Code is a working model if someone wants to take a look at it.
source share