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.js
containaws_appsync_apiKey
? If you're usingamplify 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 youramplify/backend/backend-config.json
file, do you have anapi.<API_NAME>.output.authConfig
property that has values in theadditionalAuthenticationProviders
anddefaultAuthentication
?Yes, I do.
AMAZON_COGNITO_USER_POOLS
is underdefaultAuthentication
andAPI_KEY
is underadditionalAuthenticationProviders