Minor bug: shows up in the web console as a failed POST:
POST https://cognito-identity.us-east-2.amazonaws.com/ 400 (Bad Request)
Steps:
create-react-app and awsmobile pullAmplify.configure(awsmobilejs) as usual.npm start and examine the web console.I would expect Amplify to notice that sign-in is required, and not attempt any Cognito calls prior to sign-in.
Amplify 0.2.6 does not seem to use the aws_mandatory_sign_in element of aws-exports.js.
@ceich thanks for your feedback!
@ceich this bug has been fixed in the latest release. Please feel free to reopen the issue if neccessary.
I no longer see this at configure() time, but do see this and another error at federated login time. Do you want me to submit a new issue, or to reopen this one?
I do see this when call
AwsAuth.configure({
identityPoolId: 'xxx',
region: 'xxx',
userPoolId: 'xxx',
userPoolWebClientId: 'xxx',
mandatorySignIn: false,
});
if I don't pass identityPoolId, I would not see the error. The problem is that I cannot know what's wrong here, the body of the 400 response is just an alien string to me
It seems that I should set mandatorySignIn to true, then the error will go.
+1
It's because if you have the identitypoolId then Amplify will automatically try to get a guest credentials for you which will lead to that http request failing because you didn't turn the mandatorySignIn to true.
Could not find any the mandatory option.
This is what worked for me:
in: amplify/backend/auth/[PROJECT]/parameters.json
set: "allowUnauthenticatedIdentities": true
@SplicePHP it's in the configuration: https://aws-amplify.github.io/amplify-js/media/authentication_guide.html#manual-setup
Most helpful comment
It seems that I should set mandatorySignIn to true, then the error will go.