nokia / kong-oidc

OIDC plugin for Kong
Apache License 2.0
454 stars 320 forks source link

Guidance to implement configurable cookie names #156

Open code4dc opened 4 years ago

code4dc commented 4 years ago

My company is trying to modify the kong-oidc plugin to allow the names of the Authorization and session cookies to be configurable. This is to avoid a name clash with other components of our system.

Do you guys have any suggestion on where these changes might be made? I believe kong's enterprise version of this plugin allows for this but I could not find anywhere in the code where these changes may be made.

Thank you!

mssaisandeep commented 4 years ago

You can configure by sending the session_opts as shown below:

In handler.lua (55th line) can be changed as follows: local session_opts = { name=""} local resp, err = require("resty.openidc").authenticate(oidcConfig, nil, nil, session_opts)

mssaisandeep commented 4 years ago

FYI, session_opts can be extended and provide all lua_resty_session variables such as cookie domain name, path, lifetime, and many more.

https://github.com/bungle/lua-resty-session#fields

For example "session.cookie.lifetme" will be given as "session_opts = { cookie={lifetime=xxx}}" l