I'm using: https://github.com/aws-amplify/amplify-js
Is there any working example how to use authenticated access to AWS? I'm using this:
Amplify.configure({ Auth: { identityPoolId: configs.broker.identityPoolId, region: configs.broker.aws_pubsub_region, userPoolId: configs.broker.userPoolId, userPoolWebClientId: configs.broker.userPoolWebClientId, } }); Amplify.addPluggable(new AWSIoTProvider(configs.broker)); Auth.signIn(configs.broker.username, configs.broker.password) .then(user => { resolve({ code: 200, message: 'Authorized access to AWS is used' }) }) .catch(singInErr => resolve({ code: 500, message: singInErr.message })); And if it is OK (it is ok):
PubSub.publish(configs.broker.topic, JSON.stringify(data)) .then(res => resolve({ code: 200, message: 'OK' })) .catch(err => resolve({ code: 500, message: err.toString() })); But I keep getting:
[Unhandled promise rejection: NotAuthorizedException: Unauthenticated access is not supported for this identity pool.]