I set up my reactJs app with Amplify for the login:
Amplify.configure({
Auth: {
mandatorySignIn: true,
region: config.cognito.REGION,
userPoolId: config.cognito.USER_POOL_ID,
identityPoolId: config.cognito.IDENTITY_POOL_ID,
userPoolWebClientId: config.cognito.APP_CLIENT_ID
}
,
Storage: {
region: config.s3.REGION,
bucket: config.s3.BUCKET,
identityPoolId: config.cognito.IDENTITY_POOL_ID
}
and I get this error message:
{[WARN] 46:26.205 StorageClass - ensure credentials error: "cannot get guest credentials when mandatory signin enabled"}
Then when I try to get the file from s3 with this code:
Storage.get('google_pictures/P00000392.jpg')
.then(function(result) {
console.log(result);
})
.catch(function(err) {
console.log(err);
});
I get the "No Credential" message.
The permission are set in the identity pool connected to the user pool that is used for the login.
@grugna if you set mandatorySignIn to true, then users are not allowed to get the aws credentials and use the S3 unless they are signed in.
@powerful23 thank you for the response. I didn't mention it but I do the login like suggested on the documentation:
await Auth.signIn(this.state.email, this.state.password);
My problem was that the user in the User Pool was flagged to change is password, so he would never get his role until the password was updated.
@powerful23 Would there be a way to make the error message more specific in @grugna's case?
@philippefutureboy we have the plan to improve those error messages in our roadmap.
Wonderful! Any ETA?
Most helpful comment
Wonderful! Any ETA?