0

I found a tutorial how to setup kong with two open source plugins to get keycloak working with kong, but unfortunately it is 2 years old and I ran in troubles.

Most of the steps still worked and I was able to install the plugin versions in the tutorial via luarocks. unfortunately, the kong did not restart after configuring it to work with the plugins:

plungins = bundeld,oidc,jwt-keycloak

running in the error, that the kong.plugins.base_plugin cannot be found:

Error: /usr/local/share/lua/5.1/kong/tools/utils.lua:708: error loading module 'kong.plugins.oidc.handler':
/usr/local/share/lua/5.1/kong/plugins/oidc/handler.lua:1: module 'kong.plugins.base_plugin' not found:No LuaRocks module found for kong.plugins.base_plugin
    no field package.preload['kong.plugins.base_plugin']

What I tried

  • I tried to install a base_plugin but lua does not find any.
  • I was googling a lot, but did't quite found the same issue.

Well, I am quite stuck and was wondering if there is an other way (maybe directly with the oAuth plugin?), or how I can fix this issue. Also I don't really know how debug that issue and am happy for ideas!

1 Answer 1

1

The root cause is BasePlugin is deprecated and removed from kong 3.x,see it here.The jwt-keycloak plugin imported BasePlugin in handler.lua, so you have to do the migration by yourself,it's easy,just fork its repo,change code,install it from source in Dockerfile。

2
  • Please share with me the details about: "change code" of your answer.
    – helle
    Commented Jan 5, 2023 at 9:16
  • 1
    github.com/zjjfly/kong-plugin-jwt-keycloak, this is my repo forked from gbbirkisson's repo,you can find my changes in commit history
    – 资俊杰
    Commented Jan 16, 2023 at 7:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.