Skip to content

Commit

Permalink
add CORSMiddleware
Browse files Browse the repository at this point in the history
  • Loading branch information
johanlundberg committed Oct 20, 2023
1 parent 4689c38 commit 17f14de
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/auth_server/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Dict, Type, cast

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from starlette.staticfiles import StaticFiles

from auth_server.config import AuthServerConfig, ConfigurationError, FlowName, load_config
Expand Down Expand Up @@ -65,6 +66,13 @@ def init_auth_server_api() -> AuthServer:
app = AuthServer()
app.router.route_class = ContextRequestRoute
app.add_middleware(JOSEMiddleware)
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(root_router)
app.include_router(interaction_router)
app.include_router(saml2_router)
Expand Down

0 comments on commit 17f14de

Please sign in to comment.