I want to add this endpoint /graphql
in kong for both anonymous and authenticated users :
- if the apikey is provided consider it as authenticated
- othwerwise consider it as anonymous
Try the config.anonymous
field in the key-auth plugin I think by:
creating a consumer that you can call ‘anoynmous’ with and id 0 for example
use the kong id of that consumer in anonymous field
update your custom code (KongAuthentication) and check if HTTP_X_CONSUMER_CUSTOM_ID = 0 then return AnonymousUser (django.contrib.auth.models.AnonymousUser)