DEV Community

Discussion on: Multiple Authentication Types in AWS Amplify

Collapse
 
robertbroersma profile image
Robert

What you could also do is initialize 2 API clients, one with API_KEY as the default and one with AMAZON_COGNITO_USER_POOLS as the default, then use the public one in the public part of your app, and the private one in the private part of your app.

I'm not sure if this is possible using Amplify, but you could simply write your own wrapper!

Collapse
 
starpebble profile image
starpebble

Slightly less code, to not have to set 'authMode' for each API.graphql() invocation! This is very interesting. A single AppSync endpoint has a single default authorizer. A single Amplify GraphQL client instance may have a single default authorization mode. It's up to the developer to evolve this god for saken security model!