From 7409bd1eb8a5feac10ed5afcb00e813ec11e3909 Mon Sep 17 00:00:00 2001 From: Salomon Popp Date: Tue, 27 Feb 2024 10:26:09 +0000 Subject: [PATCH] Add SessionMiddleware to Readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0d2a35d..47b94f0 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ pip install keycloak-oauth[fastapi] ```python from fastapi import FastAPI +from starlette.middleware.sessions import SessionMiddleware from backend.settings import settings, BASE_URL # secrets from keycloak_oauth import KeycloakOAuth2 @@ -26,6 +27,7 @@ keycloak = KeycloakOAuth2( keycloak.setup_fastapi_routes() app = FastAPI() +app.add_middleware(SessionMiddleware, secret_key="secret0123456789") app.include_router(keycloak.router, prefix="/auth") ```