Files
css-test/app/core/auth.py
T
paul d50c1c5bba feat: Initialize FastAPI application with Azure authentication and transaction management
- Added .env.example for environment variable configuration.
- Created app initialization files and core settings management.
- Implemented API routers for reporting and transaction endpoints.
- Developed transaction management service with CRUD operations.
- Integrated Azure OAuth for user authentication.
- Designed dashboard view with transaction filtering and display.
- Added Swagger UI documentation with custom dark theme.
- Created static and template files for frontend styling and layout.
2026-05-10 22:17:30 +12:00

23 lines
610 B
Python

from functools import lru_cache
from authlib.integrations.starlette_client import OAuth
from app.core.settings import get_settings
@lru_cache
def get_oauth() -> OAuth:
settings = get_settings()
oauth = OAuth()
oauth.register(
name="azure",
client_id=settings.azure_client_id,
client_secret=settings.azure_client_secret,
server_metadata_url=(
f"https://login.microsoftonline.com/{settings.azure_tenant_id}"
"/v2.0/.well-known/openid-configuration"
),
client_kwargs={"scope": "openid profile email"},
)
return oauth