2.4 KiB
2.4 KiB
Visione Local CIE Stack
This folder is a ready-to-run local stack for CIE auth integration with Visione.
Included services:
federation-authorityproviderrelying-party
They run through one compose file and use the modified relying party bridge for Visione.
Prerequisites
- Visione backend running on
http://127.0.0.1:5555 - Docker with Compose
Visione config
Set in config.json:
"cie_auth": {
"service_base_url": "http://127.0.0.1:8001",
"start_path": "/visione/start",
"shared_secret": "change-me-for-local-dev",
"state_ttl_minutes": 10,
"default_frontend_redirect_uri": "http://localhost:3000/auth/cie/callback"
}
Keep same secret also in:
relying_party/relying_party/settingslocal.pyVISIONE_SHARED_SECRET
Start stack
From repo root:
docker compose up -d
docker compose -f infra/cie-auth/docker-compose.yml up --build -d
This starts:
- MySQL + Mailpit from root compose
- authority on
127.0.0.1:8000 - provider on
127.0.0.1:8002 - relying party on
127.0.0.1:8001
Start Visione
From repo root:
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build
./build/visione-backend
Smoke test
Start login:
curl -sS -X POST http://127.0.0.1:5555/api/v1/auth/cie/start \
-H 'Content-Type: application/json' \
-d '{"frontend_redirect_uri":"http://localhost:3000/auth/cie/callback"}'
Expected JSON:
authorization_urlstate
Then:
- open
authorization_urlin browser - complete demo CIE login
- browser lands on
http://localhost:3000/auth/cie/callback?state=...
Poll result:
curl -sS http://127.0.0.1:5555/api/v1/auth/cie/session/<state>
Expected success:
status = "authenticated"auth.tokenpresent
Frontend flow
- call
POST /api/v1/auth/cie/start - redirect browser to
authorization_url - callback page reads
state - poll
GET /api/v1/auth/cie/session/{state} - when authenticated, save
auth.token - call
GET /api/v1/me
Reset local auth DBs
If you want a clean auth stack:
rm -f infra/cie-auth/federation_authority/db.sqlite3
rm -f infra/cie-auth/provider/db.sqlite3
rm -f infra/cie-auth/relying_party/db.sqlite3
docker compose -f infra/cie-auth/docker-compose.yml down
docker compose -f infra/cie-auth/docker-compose.yml up --build -d
Logs
docker compose -f infra/cie-auth/docker-compose.yml logs -f