Context:
I am trying to use Kong + OpenIDC (Custom plugin), based on nokia/kong-oidc
The setup is using docker desktop.
I run luarocks install lua-resty-openidc while building the custom kong image.
Following the code-snippet from my handler.lua:
local res, err = require("resty.openidc").authenticate(oidcConfig)
if err then
if oidcConfig.recovery_page_path then
ngx.log(ngx.NOTICE, "Entering recovery page: " .. oidcConfig.recovery_page_path)
ngx.redirect(oidcConfig.recovery_page_path)
end
utils.exit(500, err, ngx.HTTP_INTERNAL_SERVER_ERROR)
end
I get the following error:
attempt to call method 'start' (a nil value), client: 172.18.0.1, server: kong, request: "GET /mock HTTP/1.1", host: "localhost:8000", request_id: "7df8870a8d3fa916cf1c5a540f2b9f3f"
I figured that it was from session:start() present in openidc.
It seemed that session was not getting initialized, so I tried similar in my local handler.lua.
Following is the code from my local handler.lua (inspired from openidc)
local session, err, ret = require("resty.session").open(nil)
if (session ~= nil) then
ngx.log(ngx.NOTICE,"session is not nil")
ngx.log(ngx.DEBUG,
"session.present=", session.present,
", session.data.id_token=", session.data.id_token ~= nil,
", session.data.authenticated=", session.data.authenticated,
", err=", err,
", ret=",ret
)
session:start()
else
ngx.log(ngx.NOTICE, "Session is nil")
end
I observe that session is not null and err is printed is as "missing session cookie".
Here is the snippet of the logs
Context: I am trying to use Kong + OpenIDC (Custom plugin), based on nokia/kong-oidc The setup is using docker desktop.
I run l
uarocks install lua-resty-openidc
while building the custom kong image.Following the code-snippet from my handler.lua:
I get the following error:
attempt to call method 'start' (a nil value), client: 172.18.0.1, server: kong, request: "GET /mock HTTP/1.1", host: "localhost:8000", request_id: "7df8870a8d3fa916cf1c5a540f2b9f3f"
I figured that it was from
session:start()
present in openidc. It seemed that session was not getting initialized, so I tried similar in my local handler.lua. Following is the code from my local handler.lua (inspired from openidc)I observe that session is not null and err is printed is as "missing session cookie". Here is the snippet of the logs
Not sure what am I missing here. Any pointers are appreciated.