Skip to content

Commit

Permalink
Add SessionMiddleware to Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
disrupted committed Feb 27, 2024
1 parent 8c7298d commit 7409bd1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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")
```

Expand Down

0 comments on commit 7409bd1

Please sign in to comment.