One thing I ran into is that I was trying to configure the API key by running amplify add auth (I figured making stuff public has to do with auth?), while that should be done in amplify add/update api, but it doesn't sound like that's what's happening to you.
Does your generated aws-exports.js contain aws_appsync_apiKey? If you're using amplify mock it might remove some stuff from there when you shut it down.
It actually does, it also has the keys for the cognito user: aws_user_pools_id. In your amplify/backend/backend-config.json file, do you have an api.<API_NAME>.output.authConfig property that has values in the additionalAuthenticationProviders and defaultAuthentication?
Hey Russ. I'm using @aws-amplify/cli@4.13.4
One thing I ran into is that I was trying to configure the API key by running
amplify add auth(I figured making stuff public has to do with auth?), while that should be done inamplify add/update api, but it doesn't sound like that's what's happening to you.Does your generated
aws-exports.jscontainaws_appsync_apiKey? If you're usingamplify mockit might remove some stuff from there when you shut it down.It actually does, it also has the keys for the cognito user:
aws_user_pools_id. In youramplify/backend/backend-config.jsonfile, do you have anapi.<API_NAME>.output.authConfigproperty that has values in theadditionalAuthenticationProvidersanddefaultAuthentication?Yes, I do.
AMAZON_COGNITO_USER_POOLSis underdefaultAuthenticationandAPI_KEYis underadditionalAuthenticationProviders