DEV Community

Discussion on: Multiple Authentication Types in AWS Amplify

Collapse
 
robertbroersma profile image
Robert

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 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.

Collapse
 
russmax783 profile image
Russ

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?

Thread Thread
 
robertbroersma profile image
Robert

Yes, I do. AMAZON_COGNITO_USER_POOLS is under defaultAuthentication and API_KEY is under additionalAuthenticationProviders