# Invalid authentication credentials - basic-auth

**URL:** <https://discuss.konghq.com/t/invalid-authentication-credentials-basic-auth/7637>\
**Category:** Questions\
**Tags:** kubernetes\
**Created:** [December 20, 2020, 2:35pm UTC](https://discuss.konghq.com/t/invalid-authentication-credentials-basic-auth/7637 "2020-12-20T14:35:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashishj16](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@ashishj16](https://discuss.konghq.com/u/ashishj16)\
**Post date:** [December 20, 2020, 2:35pm UTC](https://discuss.konghq.com/t/invalid-authentication-credentials-basic-auth/7637/1 "2020-12-20T14:35:15Z")

</div>

I am new for Kong API and doing POC for basic-auth plugin but getting exception, please help to resolve. The basic auth plugin working with the kong ingress controller. This is my current setup:

```
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: demo.yolo42.com
  annotations:
    kubernetes.io/ingress.class: kong
    konghq.com/plugins: basic-auth-example
spec:
  rules:
  - host: demo.yolo42.com
  - http:
      paths:
      - path: /foo
        backend:
          serviceName: echo
          servicePort: 80
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: basic-auth-example
config:
  hide_credentials: true
plugin: basic-auth
---
apiVersion: configuration.konghq.com/v1
kind: KongConsumer
metadata:
  name: test
  annotations:
    kubernetes.io/ingress.class: kong
username: "xyz"
credentials:
 - user-key
---
apiVersion: v1
kind: Secret
metadata:
  name: user-key
stringData:
  kongCredType: basic-auth
  password: "XXXX"
```
