Basic auth not working anymore with kong 2.1.4

Hi,

I have recently updated kong from 1.4.2 to 2.1.4 (with db).

I used to have protected routes using the basic auth plugin.

However after the updates, I have always the same error:

401 : Invalid Credentials. Even with the right credentials …

I am using kong with kong-ingress-controller (0.6.0) on a k8s cluster:


apiVersion: configuration.konghq.com/v1
kind: KongConsumer
metadata:
  name: prometheus-user
  namespace: monitoring
username: prometheus-user
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: auth-prometheus
  namespace: monitoring
plugin: basic-auth
config:
  hide_credentials: true
---
apiVersion: configuration.konghq.com/v1
kind: KongCredential
metadata:
  name: prometheus-user-credential
  namespace: monitoring
consumerRef: prometheus-user
type: basic-auth
config:
  username: user
  password: password

what should I do ? I thnik that it is linked with kong credentials and the new kong 2 support

You’ll need to upgrade your controller image as well as your Kong image. I’d recommend using the latest 1.0.0 release.

Note that current releases of the controller have stricter requirements for specifying ingress class information. It looks like you aren’t currently adding that to your KongConsumer, so you’ll need to add class annotations in addition to the controller version upgrade. Your Ingress resources will need that annotation as well; the value should be kong.


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ