keycloak-nodejs-connect icon indicating copy to clipboard operation
keycloak-nodejs-connect copied to clipboard

provide options to cookie storage

Open apiel opened this issue 2 years ago • 1 comments

Allow user to provide custom options for cookie storage like httpOnly mode or custom expiration date:

const keycloak = new Keycloak(
        { 
            cookies: true,
            cookieOptions: { maxAge: 900000, httpOnly: true },
        },
        {
            realm: 'example',
            // ...
        }
};

apiel avatar Jan 10 '22 07:01 apiel

I would like to see this added as well. A workaround for me has been:

		app.use(function (req, res, next) {
			var org = res.cookie;
			res.cookie = function (name, value, options) {
				// Change options here
				org.call(this, name, value, options);
			};
			next()
		})

oleaasbo avatar Jan 12 '22 22:01 oleaasbo