Basic-auth plugin in hybrid mode


I have been trying to make basic-auth plugin work in hybrid mode, but when I try to create consumer credentials, changes on control plane are not propagated to data plane. According to this post it should work for auth plugins, and for key-auth it actually works fine. Is this intended behavior or some bug in basic-auth plugin?

I also tried to investigate more, so I setup one control plane (listening on port 8001) and one data plane (listening on port 9000) in my Docker. Here is how it works for key-auth, for existing consumer ‘test’:

curl localhost:8001/clustering/status

curl -X POST 'http://localhost:8001/consumers/test/key-auth' -d ''

curl localhost:8001/clustering/status

Note that config hash has been changed, data-plane receives updated credentials and new API key is working.

When I try the same for basic-auth, it works as follow:

curl -X POST 'http://localhost:8001/consumers/test/basic-auth' \
    --header 'Content-Type: application/json' \
    --data-raw '{"username": "aaaa", "password": "def"}'


curl localhost:8001/clustering/status

Config hash is NOT changed and credentials are not propagated to data plane.

OK I have find out where the issue is. In basic-auth/daos.lua, db_export parameter is set to false. Although it is primarily used for CLI kong config db_export, apparently this mechanism is also used in propagating changes to data plane. By setting this parameter to true, changes in credentials are propagated to data plane. There is still one catch though, as the data plane receives hash of the password and when storing it in cache, it is hashed once again (see daos.lua, transformation section).

I see two possible solutions to this:

  • store passwords in basic-auth in plain text (which is security risk, but e.g. OAuth secrets are stored in plain as well)
  • do not hash passwords on data plane when getting config from control plane (this requires slight difference in code for data and control planes, but in data plane hash is enough to check the credentials).

Anyway, it worked for me eventually so this can be marked as solved.

This is a bug. Can you please open a new bug at

Thank you for confirming this. Raised as