# How to create a credential for Basic Auth without Database?

**URL:** <https://discuss.konghq.com/t/how-to-create-a-credential-for-basic-auth-without-database/9037>\
**Category:** Questions\
**Created:** [September 13, 2021, 5:51am UTC](https://discuss.konghq.com/t/how-to-create-a-credential-for-basic-auth-without-database/9037 "2021-09-13T05:51:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![oam123](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/oam123/32/2987_2.png) [@oam123](https://discuss.konghq.com/u/oam123)\
**Post date:** [September 13, 2021, 5:51am UTC](https://discuss.konghq.com/t/how-to-create-a-credential-for-basic-auth-without-database/9037/1 "2021-09-13T05:51:09Z")

</div>

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

```auto
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 | Kong Docs](https://docs.konghq.com/hub/kong-inc/basic-auth/) 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.

---

<div class="post-metadata">

**Author:** ![fomm](https://avatars.discourse-cdn.com/v4/letter/f/ea666f/32.png) [@fomm](https://discuss.konghq.com/u/fomm)\
**Post date:** [September 13, 2021, 6:24am UTC](https://discuss.konghq.com/t/how-to-create-a-credential-for-basic-auth-without-database/9037/2 "2021-09-13T06:24:40Z")

</div>

You should map credential to consumer `username`, **NOT** `custom_id`.

Below should work.

```auto
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

```
