Overview
Every Open Banking API call is authorised by a consent. Not a token, not a session — a consent. The consent is the legal and technical artefact that says: this customer, on this date, authorised this TPP to access these accounts for these purposes, until this date. Get that right and everything downstream is tractable. Get it wrong and you have an audit trail that satisfies nobody, a revocation mechanism that doesn’t propagate, and a TPP ecosystem that loses confidence in the platform.
The article covers the four hard parts: the consent data model, the CIBA flow that makes mobile-first consent workable, dynamic client registration for TPP onboarding, and the revocation mechanics that need to work under peak load on a public holiday. Roles follow the Open Banking specifications: the ASPSP (the account-servicing institution that holds the data and runs the authorisation server) and the TPP (the licensed third party requesting access).
The canonical mistake is storing consent as a JWT claim and trusting it for the lifetime of the token. Consent is a living entity — it can be partially revoked (remove one account from scope), suspended by the ASPSP (fraud hold), or expired (reached the agreed end date). Token validation must check a live consent store on every call to the resource API, not just on token issuance. This is the design decision that separates a real consent platform from an OAuth implementation with a consent screen bolted on.
Consent data model
A consent record needs to carry enough information to reconstruct the authorisation decision at any future point — for audit, for dispute, and for real-time enforcement. The minimal production-grade model:
{
"consentId": "csnt-0e4f1a2b-3c5d",
"status": "AUTHORISED",
"statusUpdatedAt": "2026-05-17T09:14:00Z",
"createdAt": "2026-05-17T09:10:00Z",
"expiresAt": "2027-05-17T00:00:00Z",
"tppId": "tpp-example-fintech",
"customerId": "cust-redacted-hash",
"permissions": [
"ReadAccountsBasic",
"ReadAccountsDetail",
"ReadBalances",
"ReadTransactionsCredits",
"ReadTransactionsDebits"
],
"accounts": [
{ "accountId": "acc-001", "currency": "SAR" },
{ "accountId": "acc-002", "currency": "USD" }
],
"transactionFromDate": "2026-01-01",
"transactionToDate": "2026-12-31",
"authorisationId": "auth-7f8e9d0a",
"accessToken": { "expiresAt": "2026-05-17T09:44:00Z" },
"refreshToken": { "expiresAt": "2026-06-17T09:14:00Z" }
}
customerId is a hashed reference — personal data stays in the system of record — and authorisationId links the consent to the strong-customer-authentication event that approved it.
Consent status is an enum. Transitions are one-way except where the framework allows reauthorisation:
| Status | Meaning | Who can set it | Reversible? |
|---|---|---|---|
AWAITING_AUTHORISATION | Created by TPP, not yet confirmed by customer | ASPSP (on DCR or consent creation) | Yes → AUTHORISED |
AUTHORISED | Customer confirmed via SCA | ASPSP (post-SCA) | Yes → REVOKED or EXPIRED |
REVOKED | Cancelled by customer, ASPSP or TPP | Customer (portal), ASPSP (fraud), TPP (DELETE endpoint) | No |
EXPIRED | Past expiresAt or token TTL | System (scheduler) | No |
REJECTED | Customer declined at SCA screen | ASPSP (post-SCA decline) | No |
SUSPENDED | Temporarily blocked (fraud hold, sanction check) | ASPSP only | Yes → AUTHORISED |
CIBA flow
CIBA (Client-Initiated Backchannel Authentication, an OpenID Foundation specification) decouples the authentication device from the session initiating the request. In an Open Banking context: the TPP’s web app initiates the consent request, the ASPSP sends a push notification to the customer’s mobile banking app, the customer confirms on their phone, and the TPP’s server polls or receives a callback. No redirect. No browser pop-up. Decoupled flows like this are increasingly favoured for payment initiation because they keep the authentication on a trusted, ASPSP-enrolled device rather than in a browser the TPP controls.
The key property: the TPP never handles the authentication. Steps 3–5 happen entirely on the customer’s ASPSP-enrolled device. The auth_req_id is a short-lived (120s) handle that ties the polling at step 6 to the SCA event at step 5.
The auth_req_id must be cryptographically bound to the consent payload submitted at step 1. A naive implementation generates the id independently and looks up the consent at token issuance — leaving a window where a rogue auth_req_id can be substituted. Embed the consent hash in the auth_req_id, verify on token issuance.
Dynamic client registration
TPPs cannot be pre-registered by email. The volumes are wrong and the automation requirement is absolute. Dynamic Client Registration (RFC 7591, OIDC DCR) is the mechanism: the TPP presents a software statement assertion (SSA) — a JWT signed by the scheme’s trust directory — and the ASPSP’s AS registers the TPP client and returns a client_id.
Each scheme names its own SSA issuer: the Open Banking Directory in the UK, the central directory of a national scheme such as Brazil’s or Saudi Arabia’s, and so on. An ASPSP that runs its own DCR endpoint must validate the SSA signature against the issuing directory’s JWKS before creating the client record.
{
"software_statement": "eyJhbGciOiJQUzI1NiIsImtpZCI6ImRpci0yMDI2In0...",
"redirect_uris": ["https://tpp.example.com/callback"],
"token_endpoint_auth_method": "private_key_jwt",
"grant_types": ["authorization_code", "urn:openid:params:grant-type:ciba", "refresh_token"],
"response_types": ["code"],
"request_object_signing_alg": "PS256",
"backchannel_token_delivery_mode": "poll",
"tls_client_certificate_bound_access_tokens": true,
"scope": "openid accounts payments"
}
{
"client_id": "tpp-example-fintech",
"client_id_issued_at": 1747476600,
"registration_access_token": "rat-...",
"registration_client_uri": "https://as.aspsp.example/register/tpp-example-fintech"
}
The CIBA grant type is urn:openid:params:grant-type:ciba. The FAPI CIBA profile allows the poll and ping delivery modes but not push. tls_client_certificate_bound_access_tokens (RFC 8705) asks for tokens bound to the TPP’s transport certificate; a TPP that authenticates with the certificate itself would register tls_client_auth and tls_client_auth_subject_dn instead of private_key_jwt.
The registration_access_token (RAT) is the only credential the TPP uses to update or delete its own registration. Treat it like a long-lived client secret: store it encrypted, rotate it annually, revoke it immediately on suspected compromise.
Neither RFC 7591 nor FAPI 2.0 defines what happens when a TPP submits the same SSA twice, so decide it — and follow your scheme’s rules where it has them. A sound default for a retried registration is to return the existing client_id rather than create a duplicate. The software_id claim inside the SSA is the deduplication key. Index the client table on software_id, not on the outer client object.
Consent creation
Consent creation is a two-step process. The TPP creates the consent resource (a POST /consents call that returns a consentId in AWAITING_AUTHORISATION status), then the customer authorises it via CIBA or redirect. Both steps are FAPI-secured: PAR + JAR on the authorization request, private_key_jwt on the token request.
# Step 1: TPP creates the consent resource (server-to-server, not user-facing).
# The client certificate provides mTLS client authentication and token binding.
curl -sS https://api.aspsp.example/open-banking/v3/aisp/consents \
--cert "$TPP_CERT" --key "$TPP_KEY" \
-H "Authorization: Bearer $CCG_TOKEN" \
-H "Content-Type: application/json" \
-H "x-fapi-interaction-id: $(uuidgen)" \
-d '{
"Data": {
"Permissions": ["ReadAccountsBasic","ReadBalances","ReadTransactionsCredits"],
"ExpirationDateTime": "2027-05-17T00:00:00Z",
"TransactionFromDateTime": "2026-01-01T00:00:00Z",
"TransactionToDateTime": "2026-12-31T23:59:59Z"
},
"Risk": {}
}'
# Returns: { "Data": { "ConsentId": "csnt-0e4f1a2b", "Status": "AwaitingAuthorisation" } }
# Step 2: push the authorization request (PAR, RFC 9126). With a signed request
# object (JAR, PS256) the parameters - including the consent id in the claims -
# travel inside the JWT; the client authenticates with private_key_jwt.
curl -sS https://as.aspsp.example/par \
--cert "$TPP_CERT" --key "$TPP_KEY" \
-d "client_id=$CLIENT_ID" \
-d "client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer" \
-d "client_assertion=$(sign_client_assertion)" \
-d "request=$(sign_jar_jwt)"
# Returns: { "request_uri": "urn:ietf:params:oauth:request_uri:...", "expires_in": 60 }
# The customer is then redirected to /authorize?client_id=...&request_uri=...
# A decoupled journey calls the CIBA backchannel authentication endpoint instead.
Strong customer authentication
Open Banking regimes generally mandate SCA for consent authorisation and for payment initiation (PSD2’s RTS in the EU and UK is the best-known example; other national schemes, including SAMA’s in Saudi Arabia, set equivalent rules), with exemptions defined scheme by scheme. SCA requires two of: something you know (PIN), something you have (OTP device / app), something you are (biometric). For the mobile banking app flow, biometric + push notification satisfies the “have + are” combination without a PIN step — which is the UX the market expects.
The SCA event must be cryptographically linked to the consent. The approach:
- Consent hash in push payload. The FCM/APNs push notification includes a signed hash of the consent payload (permissions, accounts, dates). The app displays this to the customer; they are authenticating a specific consent object, not just a generic approval screen.
- Device binding check. The AS verifies the push was delivered to a device bound to the customer’s profile. A new device that has not completed device registration cannot receive open banking consent pushes — this is separate from the device used for online-banking login.
- Biometric attestation. On iOS/Android, the biometric challenge produces a platform-signed assertion (FIDO2 / WebAuthn authenticator assertion). The app forwards this to the AS. The AS verifies the assertion against the registered public key for that device.
- Consent status transition is atomic. The status update from AWAITING_AUTHORISATION to AUTHORISED is a single database transaction that also writes the authorisation_id (linking to the SCA event record). No intermediate states, no dual writes.
- auth_req_id expires independently. If the customer does not respond within the auth_req_id TTL (typically 120–300s), the consent status moves to REJECTED and the TPP’s poll returns
expired_tokenat the token endpoint. - Re-authorisation is a new consent. A rejected consent cannot be approved. The TPP must create a new consent resource and start the CIBA flow again. This is intentional: it closes the window where a delayed approval could be intercepted and replayed.
Revocation mechanics
Revocation is the part that most implementations get wrong. The consent is revoked — but are the tokens revoked? Is the customer’s dashboard updated? Is the TPP notified? There are three revocation paths, each with different propagation requirements.
| Initiator | Mechanism | Token effect | Propagation |
|---|---|---|---|
| Customer (ASPSP portal / mobile) | PATCH or DELETE on consent resource via ASPSP UI | All tokens under that consentId revoked immediately | TPP notified via event notification (webhook or polling the consent status endpoint) |
| TPP | DELETE /consents/{consentId} | TPP’s own tokens revoked; customer notified in ASPSP portal | ASPSP marks consent REVOKED; no further calls accepted under that id |
| ASPSP (fraud/compliance) | Internal admin API; can revoke consent or suspend client | All tokens revoked; client registration can be suspended | TPP receives 403 on next call with specific error code indicating revocation |
| System (expiry) | Scheduled job runs every hour; marks consents past expiresAt as EXPIRED | Refresh tokens revoked; access tokens expiry enforced at resource API | No active notification; TPP discovers on next token refresh (401) |
If your resource API validates tokens by checking only the JWT signature and expiry claim (stateless validation), a revoked consent does nothing until the access token naturally expires — potentially 15 minutes after the customer clicked “remove access”. Under most Open Banking frameworks, this is a breach of the consent terms. The resource server must call the consent store on every request, or subscribe to consent revocation events and maintain a local revocation cache with <1s staleness.
TPP onboarding steps
TPP onboarding is an operational process that wraps the DCR protocol. In a typical directory-based scheme it looks like this:
- Scheme directory enrolment. The TPP registers with the scheme’s central directory and receives a signed SSA. The directory verifies the TPP’s licence, legal entity, and regulatory standing. The ASPSP does not repeat this check — it trusts the SSA signature.
- Sandbox DCR and E2E test. The TPP calls the ASPSP’s sandbox DCR endpoint with the SSA. The AS creates a sandbox client. The TPP runs the full consent + data retrieval flow against synthetic accounts. Sandbox must mirror production FAPI profile exactly.
- Production DCR. After sandbox sign-off, the TPP calls the production DCR endpoint. The AS validates the production SSA (different signing key from sandbox), creates the production client, and returns the client_id. No human approval step — the directory-signed SSA is the trust anchor.
- mTLS certificate exchange. The TPP’s transport certificate DN is registered against the client_id. The ASPSP’s API gateway enforces mTLS on all TPP calls and maps the cert DN to the client_id for rate limiting and audit. A cert rotation by the TPP requires a DCR PATCH call, not an email.
- Consent notification endpoint registration. The TPP registers a webhook URL for consent event notifications (AUTHORISED, REVOKED, EXPIRED). The ASPSP sends signed event notifications (JWS) to this URL within 5 minutes of a status change. The TPP webhook must accept and return 202 within 3 seconds — long processing goes async.
Token-consent binding
Every access token issued under a consent grant must carry the consentId as a claim. The resource API must verify the consentId claim on every call and check the live consent status. This is the binding that makes revocation work.
public class ConsentAwareResourceFilter implements ContainerRequestFilter {
private final ConsentStore consentStore;
private final JwtValidator jwtValidator;
@Override
public void filter(ContainerRequestContext ctx) {
String rawToken = extractBearer(ctx);
JwtClaimsSet claims = jwtValidator.validate(rawToken);
String consentId = claims.getStringClaim("consent_id");
if (consentId == null) {
throw new WebApplicationException(Response.Status.FORBIDDEN);
}
// Live consent check — cached with 5s TTL, refreshed on MISS
Consent consent = consentStore.findById(consentId)
.orElseThrow(() -> new WebApplicationException(Response.Status.FORBIDDEN));
if (consent.getStatus() != ConsentStatus.AUTHORISED) {
ctx.abortWith(
Response.status(403)
.entity("{\"error\":\"consent_revoked\",\"consentId\":\"" + consentId + "\"}")
.build()
);
return;
}
// Enforce account scope: only accounts listed in consent are accessible
String requestedAccount = extractAccountId(ctx);
if (requestedAccount != null
&& !consent.getAccounts().contains(requestedAccount)) {
ctx.abortWith(Response.status(403)
.entity("{\"error\":\"account_not_in_consent\"}").build());
return;
}
ctx.setProperty("consent", consent);
}
}
The cache TTL of 5 seconds is the trade-off between latency (avoiding a consent store roundtrip on every call) and revocation propagation. For payment initiation, use 0-second TTL (always live) — the additional latency on write-path APIs is acceptable; delayed revocation is not.
Regional framework requirements
National Open Banking frameworks (UK, EU PSD2, Brazil, Australia CDR, Saudi Arabia and others) layer requirements on top of the base FAPI 2.0 profile. The details differ by scheme, but the categories that change architecture decisions recur everywhere:
- Consent duration caps. Schemes cap how long an AIS consent can live and define a separate duration regime for recurring or variable payment consents, often per payment type. Do not hard-code a single maximum (such as 12 months) into your consent model; parameterise by permission set, jurisdiction, and scheme phase.
- Local calendar support. Some markets require customer-facing consent displays to support a local calendar — Hijri dates in Saudi Arabia are a common example. Keep Gregorian ISO 8601 in the API and the consent record; convert in the display layer only.
- Local-language consent screens. The SCA confirmation screen must be in the customer’s language and must represent the permission set accurately in plain language. Regulators review the customer-facing text, not the English technical specification. The mapping from
ReadTransactionsCreditsto customer-readable wording in each supported language is a product decision with legal sign-off. - Multi-year audit retention. Consent lifecycle events typically have to be retained for many years (five to ten is common — check your regulator’s rule). Event sourcing the consent store is the right architecture: the current state is a projection, and the event log is the durable audit trail. A mutable status column in a relational table is not sufficient.
- Central-platform notification SLAs. Where the scheme operates a central platform that tracks consent status, status change events usually have to reach it within minutes. Treat this as a push, not a pull: your consent service must publish events to the scheme’s notification endpoint as part of the status transition, not in a downstream batch.
FAPI-derived Open Banking standards use the x-fapi-interaction-id header, a UUID that correlates a TPP request with the ASPSP’s processing. The ASPSP must echo it back in the response and log it against every operation. Auditors and dispute teams use this header to reconstruct call chains during investigations. An implementation that drops or rewrites this header in the API gateway will fail conformance testing and audit review. Log it end-to-end: gateway, consent service, resource API, and the adapter to the backend system of record.
Common pitfalls
Described above under revocation — but it comes up consistently enough to name explicitly. Teams that ship a read-only (AIS) first phase eventually have an honest conversation about whether they validate live consent status at the resource server or only at token issuance. The teams that chose the latter have that conversation again when payment initiation arrives. Fix it before payments are in production, not after.
A refresh token that references a revoked consent must return an error on the next refresh attempt, not issue a new access token. If the refresh token is stored without a consentId reference, the revocation path cannot propagate to it. The refresh token must carry or reference the consentId so the token endpoint can verify live consent status before issuing a new access token.
A DCR endpoint that does not rate-limit by IP and by SSA software_id will be abused. A credential stuffing attack against the DCR endpoint wastes compute and floods your client store. Rate limit: 10 DCR calls per software_id per hour, 50 per IP per hour. Responses to rate-limited requests must use HTTP 429, not 400 — some TPP SDK retry logic only backs off on 429.
Production checklist
- Consent store uses event sourcing; status column is a projection, not the source of truth.
- auth_req_id is cryptographically bound to the consent payload hash at creation and verified at token issuance.
- Resource API performs live consent status check on every call (cache TTL ≤5s for AIS, 0s for PIS).
- Revocation propagates tokens synchronously: revoking a consent immediately invalidates the refresh token at the token endpoint.
- DCR validates SSA signature against the scheme directory’s JWKS before creating client record.
- DCR is idempotent on
software_id: repeated registration returns existing client_id. x-fapi-interaction-idlogged end-to-end: gateway, consent service, resource API.- Consent event notifications to the central scheme platform (where one exists) are delivered within the scheme SLA.
- DCR endpoint rate-limited by software_id and IP.
- SCA confirmation screen is in the customer’s language, legally reviewed, and maps permissions to plain-language descriptions.
- Consent duration enforced by permission type and jurisdiction, not hard-coded to a single maximum.
- Audit events retained for the regulator-mandated period; tested restore path exists.