How to create a credential for Basic Auth without Database?

Hi, I’m a newbie to Kong. I’d like to set up Basic Authentication without Database way. This is my Yaml code,

plugins:
- name: prometheus
- name: syslog
- name: basic-auth
  service: my_web
  config: 
    hide_credentials: true

consumers:
- username: admin
  custom_id: admin220795

basicauth_credentials:
- consumer: admin220795
  username: sysadmin
  password: P@ssw00rd

I already follow the manual from Basic Authentication plugin | Kong Docs but I get error like this,

Error: reading file: validating file content: 1 errors occurred:
(root): Additional property basicauth_credentials is not allowed

What did I do wrong here ? please help.

You should map credential to consumer username, NOT custom_id.

Below should work.

plugins:
- name: basic-auth
  service: my_web
  config: 
    hide_credentials: true

consumers:
- username: admin
  custom_id: admin220795

basicauth_credentials:
- consumer: admin
  username: sysadmin
  password: P@ssw00rd

© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ