0.1.0 — FastAPI backend for the OpenFinance UAE Sandbox (AlTareq / Nebras)
Implements the full OAuth2 + mTLS + PAR + Consent flow with the OpenFinance sandbox using FastAPI, JWT client assertions, and PKCE.
OpenFinance/
├── .venv/
│
├── backend/
│ ├── certificates/
│ │ ├── client_signing.key
│ │ ├── client_transport.key
│ │ └── client_transport.pem
│ │
│ ├── clients/
│ │ └── open_finance_client.py
│ │
│ ├── routes/
│ │ ├── __init__.py
│ │ ├── consent_create.py
│ │ ├── debug.py
│ │ └── token.py
│ │
│ ├── services/
│ │ ├── __init__.py
│ │ ├── jwt_creator.py
│ │ ├── pkce.py
│ │ └── config.py
│ │
│ └── main.py
│
├── .env
└── requirements.txt
SIGNING_ISSUER=https://rp.sandbox.directory.openfinance.ae/openid_relying_party/60222c6e-18d2-4452-9140-0c5c23dd2c68
SIGNING_SUBJECT=https://rp.sandbox.directory.openfinance.ae/openid_relying_party/60222c6e-18d2-4452-9140-0c5c23dd2c68
SIGNING_KEY_KID=qWZUsxvD_ekbr_4aU-e_bLPHBei6JAPeKWzysb1WlFM
SIGNING_PRIVATE_KEY_PATH=backend/certificates/client_signing.key
MTLS_CERT_PATH=backend/certificates/client_transport.pem
MTLS_KEY_PATH=backend/certificates/client_transport.key
OF_REDIRECT_URI=https://docs.openfinance-hackathon.com/starter-kit/callback
OF_RESOURCE_SERVER=https://rs1.altareq1.sandbox.apihub.openfinance.ae
OF_ISSUER=https://auth1.altareq1.sandbox.apihub.openfinance.ae
OF_AUTH_ENDPOINT=https://auth1.altareq1.sandbox.apihub.openfinance.ae/auth
OF_PAR_ENDPOINT=https://as1.altareq1.sandbox.apihub.openfinance.ae/par
OF_TOKEN_ENDPOINT=https://as1.altareq1.sandbox.apihub.openfinance.ae/token
OF_JWKS=https://keystore.sandbox.directory.openfinance.ae/233bcd1d-4216-4b3c-a362-9e4a9282bba7/application.jwksSigns JWT assertions for:
/tokenexchange/par(Pushed Authorization Request)- JAR (JWT Authorization Request)
Handles HTTPX mTLS session for POSTs to /par and /token.
Creates the consent (PAR):
- Builds the JWT Request Object (JAR)
- Signs it using your private key
- Posts to
/par - Returns the auth_url for the user login step
Handles the token exchange for authorization_code grant.
uvicorn backend.main:app --reload --port 8080POST /consent-create/bank-dataLogin with sandbox credentials → approve → note the ?code= value.
curl -s -X POST http://127.0.0.1:8080/token/authorization-code -H "Content-Type: application/json" -d '{
"code": "1668752c-7edb-41dd-ac89-e45c9fe88d4c",
"code_verifier": "gtLlupLlMF0FBGtEqSXRvb47kLwUreiq0qVVicipnfg",
"redirect_uri": "https://docs.openfinance-hackathon.com/starter-kit/callback"
}' | python -m json.toolKato (Amato Alireza) (Mooj, DIFC, Dubai)
Lead Engineer / CTO — OpenFinance Hackathon Build.