-
-
Notifications
You must be signed in to change notification settings - Fork 253
Open
Description
Hello, it seems that websocket connections are always blocked, see: ZoeyVid/NPMplus#1606
This is the config used:
access_by_lua_block {
local opts = {
redirect_uri = "/npmplus-oidc/redirect_uri",
discovery = "https://<oidc-provider>/.well-known/openid-configuration", -- edit
client_id = "", -- edit
client_secret = "", -- edit
}
local session_opts = {
cookie_prefix = "LRNP-OIDC-",
cookie_http_only = true,
cookie_secure = true,
cookie_same_site = "Strict",
remember = true
}
local res, err = require("resty.openidc").authenticate(opts, nil, nil, session_opts)
if err then
ngx.status = 500
ngx.say(err)
ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)
end
ngx.req.set_header("X-USER", res.id_token.sub)
}
Adding the following fixes it, but makes all websocket request unprotected:
if ngx.var.http_upgrade and string.lower(ngx.var.http_upgrade) == "websocket" then
return
end
Since I can't test it, because I have no openidc service myself, @shedowe19 made the tests for me (see the linked Issue), where we found this bug and the possible workaround
Metadata
Metadata
Assignees
Labels
No labels