Update auth.lua to dynamically set redirect_uri and disable SSL verification.
This commit is contained in:
12
auth.lua
12
auth.lua
@@ -1,12 +1,18 @@
|
|||||||
local openidc = require("resty.openidc")
|
local openidc = require("resty.openidc")
|
||||||
|
|
||||||
|
-- Determine the correct redirect URI
|
||||||
|
local scheme = ngx.var.scheme
|
||||||
|
local host = ngx.var.http_host
|
||||||
|
local request_uri = ngx.var.request_uri
|
||||||
|
local redirect_uri = scheme .. "://" .. host .. request_uri
|
||||||
|
|
||||||
local opts = {
|
local opts = {
|
||||||
redirect_uri_path = "/redirect_uri",
|
redirect_uri = redirect_uri, -- ✅ use full URI dynamically
|
||||||
discovery = "https://kc.boomlab.party/realms/rhein-sw/.well-known/openid-configuration",
|
discovery = "https://kc.boomlab.party/realms/rhein-sw/.well-known/openid-configuration",
|
||||||
client_id = "demo-sso",
|
client_id = "demo-sso",
|
||||||
client_secret = os.getenv("KEYCLOAK_CLIENT_SECRET"),
|
client_secret = os.getenv("KEYCLOAK_CLIENT_SECRET"),
|
||||||
redirect_uri_scheme = "http",
|
scope = "openid email profile",
|
||||||
scope = "openid email profile"
|
ssl_verify = "no"
|
||||||
}
|
}
|
||||||
|
|
||||||
local res, err = openidc.authenticate(opts)
|
local res, err = openidc.authenticate(opts)
|
||||||
|
|||||||
Reference in New Issue
Block a user