Module 'resty.openidc' not found

Добрый день. Мой http.d/default.conf содержит следующую конфигурацию для авторизации в keycloak по oidc:
access_by_lua ’
local opts = {
redirect_uri_path = “/html”,
accept_none_alg = true,
discovery = “http://ip:port/auth/realms/master/.well-known/openid-configuration”,
client_id = “test_id”,
client_secret = “*”,
redirect_uri_scheme = “http”,
logout_path = “/logout”,
redirect_after_logout_uri = “http://ip:port/auth/realms/myrealm/protocol/openid-connect/logout?redirect_uri=http://localhost/”,
redirect_after_logout_with_id_token_hint = false,
session_contents = {id_token=true}
}
– call introspect for OAuth 2.0 Bearer Access Token validation
local res, err = require(“resty.openidc”).authenticate(opts)
if err then
ngx.status = 403
ngx.say(err)
ngx.exit(ngx.HTTP_FORBIDDEN)
end
';

При подключении к серверу angie я получаю 500 ошибку.
Информация в логах:
2023/06/05 10:34:28 [error] 10145#10145: *1 lua entry thread aborted: runtime error: access_by_lua(http.d/default.conf:29):15: module ‘resty.openidc’ not found:
no field package.preload[‘resty.openidc’]
no file ‘./resty/openidc.lua’
no file ‘/usr/share/angie/luajit/resty/openidc.lua’
no file ‘/usr/local/share/lua/5.1/resty/openidc.lua’
no file ‘/usr/local/share/lua/5.1/resty/openidc/init.lua’
no file ‘/usr/share/lua/5.1/resty/openidc.lua’
no file ‘/usr/share/lua/5.1/resty/openidc/init.lua’
no file ‘./resty/openidc.so’
no file ‘/usr/local/lib/lua/5.1/resty/openidc.so’
no file ‘/usr/lib/lua/5.1/resty/openidc.so’
no file ‘/usr/local/lib/lua/5.1/loadall.so’
no file ‘./resty.so’
no file ‘/usr/local/lib/lua/5.1/resty.so’
no file ‘/usr/lib/lua/5.1/resty.so’
no file ‘/usr/local/lib/lua/5.1/loadall.so’
stack traceback:
coroutine 0:
[C]: in function ‘require’

Данный конфиг отлично работал на веб-сервере openresty потому, что в него уже встроен модуль http_lua_module, но в angie его необходимо устанавливать вручную с помощью:
apt-get install -y angie-module-lua

Затем добавил две строки в angie.conf:
load_module modules/ndk_http_module.so;
load_module modules/ngx_http_lua_module.so;

Я не пойму, что я сделал не правильно, но у меня не работает и мне не хватает знаний адаптировать данный конфиг файл под angie веб-сервер.
Видимо нужно как-то изменить строку?!
“local res, err = require(“resty.openidc”).authenticate(opts)”
Или может angie еще не поддерживает openidc?
Спасибо за помощь!

Добрый день.

Данная ошибка свидетельствует о том, что модуль Angie Lua не видит Lua пакет под названием “lua-resty-openidc”. Возможно, этот Lua пакет не установлен в системе? Сразу хочу добавить что для работы “lua-resty-openidc” требуются модули “lua-cjson” и “lua-resty-string”, которые также необходимо поставить.