nokia / kong-oidc

OIDC plugin for Kong
Apache License 2.0
457 stars 324 forks source link

Kong cannot find kong-oidc module error. #13

Closed ghost closed 6 years ago

ghost commented 6 years ago

After install kong-oidc by command luarocks install kong-oidc I configs it to my api, but when I access to my api, I got this error messeges. How can I fix this?

2017/09/25 11:06:03 [error] 1561#0: *99825 lua entry thread aborted: runtime error: access_by_lua(nginx-kong-22.conf:132):40: module 'kong-oidc' not found:No LuaRocks module found for kong-oidc no field package.preload['kong-oidc'] no file 'kong-oidc/init.lua' no file './kong/kong-oidc.lua' no file '/usr/local/openresty/site/lualib/kong-oidc.lua' no file '/usr/local/openresty/site/lualib/kong-oidc/init.lua' no file '/usr/local/openresty/lualib/kong-oidc.lua' no file '/usr/local/openresty/lualib/kong-oidc/init.lua' no file './kong-oidc.lua' no file '/usr/local/openresty/luajit/share/luajit-2.1.0-beta2/kong-oidc.lua' no file '/usr/local/share/lua/5.1/kong-oidc.lua' no file '/usr/local/share/lua/5.1/kong-oidc/init.lua' no file '/usr/local/openresty/luajit/share/lua/5.1/kong-oidc.lua' no file '/usr/local/openresty/luajit/share/lua/5.1/kong-oidc/init.lua' no file '/root/.luarocks/share/lua/5.1/kong-oidc.lua' no file '/root/.luarocks/share/lua/5.1/kong-oidc/init.lua' no file '/usr/local/openresty/site/lualib/kong-oidc.so' no file '/usr/local/openresty/lualib/kong-oidc.so' no file './kong-oidc.so' no file '/usr/local/lib/lua/5.1/kong-oidc.so' no file '/usr/local/openresty/luajit/lib/lua/5.1/kong-oidc.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/root/.luarocks/lib/lua/5.1/kong-oidc.so' stack traceback: coroutine 0: [C]: in function 'require' access_by_lua(nginx-kong.conf:132):40: in function <access_by_lua(nginx-kong-22.conf:132):1>, client: xx.240.0.7, server: kong, request: "GET /api/v1/employee/add HTTP/1.1", host: "xx.xx.xx.xx:8443"

ror6ax commented 6 years ago

@dinhluong92 - thanks for deporting that! Sorry it took us long to respond. We'll look into that.

Trojan295 commented 6 years ago

Did you set the KONG_CUSTOM_PLUGINS variable after installing the kong-oidc plugin?

IMPORTANT! It should be KONG_CUSTOM_PLUGINS=oidc, not kong-oidc.

ghost commented 6 years ago

Thanks @Trojan295 , I has changed to oidc. and it works.