-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using redis with lua-resty-openidc #82
Comments
Please include a bit more code about how you use the lua-resty-session package itself to store content inside the session. Have you tried a short test without lua-resty-openidc, just try to store some data inside the session, use I suggest to create the session object directly using the constructor:
this makes debugging inside the part of code where you store data inside the session easier. |
Now I have tried it without openidc:
I get my Hello World page with the session stored in a cookie. No keys created in Redis. The redis istance (it is not a cluster, just a single instance) is just working fine: I have configured PHP to store it's session information there and can see those keys with |
Hi,
I am trying to use redis as session store in combination with lua-resty-openidc but for some reason nginx is ignoring my config my
set $session_storage redis;
and continues to store it in cookies.Here is my complete server section:
server {
listen 8080 default_server;
server_name ...;
root /data/www;
set $session_name sess_auth;
set $session_storage redis;
set $session_redis_prefix nginx;
set $session_redis_host redis.in.my.cluster.svc;
set $session_redis_port 6379;
set $session_redis_uselocking on;
set $session_redis_spinlockwait 10000;
set $session_redis_maxlockwait 30;
set $session_redis_pool_timeout 45;
set $session_redis_pool_size 10;
access_by_lua '
local opts = {
redirect_uri = "..." ,
accept_none_alg = true,
discovery = "..." ,
client_id = "...",
client_secret = "...",
redirect_uri_scheme = "http",
logout_path = "/logout",
redirect_after_logout_uri = "..." ,
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
-- Set Headers
ngx.req.set_header("REMOTE_USER", res.id_token.email)
';
expires 0;
add_header Cache-Control private;
location / {
}
}
Any Idea whats wrong here? the session_name "sess_auth" is working fine...
Thanks
The text was updated successfully, but these errors were encountered: