Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 888 Bytes

README.md

File metadata and controls

44 lines (31 loc) · 888 Bytes

Fastify Keycloak Connect

Fastify plugin for keycloak (Identity and Access Management Solution)

Usage

With fastify secure session

const fastifyKeycloak = require("fastify-keycloak");

const store = fastify.createSecureSession({});

fastify.register(fastifyKeycloak, {
  options: { store },
  middleware: { logout: "/leave" },
});

With fastify session

const fastifyKeycloak = require("fastify-keycloak");
const fastifySession = require("fastify-session");
const Store = require("fastify-session/lib/store");

const store = new Store();

fastify.register(fastifySession, { store });
fastify.register(fastifyKeycloak, {
  options: { store },
});

With fastify cookie only

const fastifyKeycloak = require("fastify-keycloak");
const Cookie = require("fastify-cookie");

fastify.register(fastifyKeycloak, {
  options: { cookies: true },
});