Amplify-js: BUG - cannot get guest credentials when mandatory signin enabled

Created on 25 Jun 2018  路  6Comments  路  Source: aws-amplify/amplify-js

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.

Auth investigating

Most helpful comment

Wonderful! Any ETA?

All 6 comments

@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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  84Comments

nomadus picture nomadus  路  57Comments

jiachen247 picture jiachen247  路  79Comments

Benzer1406 picture Benzer1406  路  62Comments

nomadus picture nomadus  路  53Comments