Skip to main content

Authentication

Comprehensive guide for Open Banking API authentication using OAuth 2.0 with mutual TLS.

🔐 Authentication Overview

Authentication Methods

Open Banking API uses dual authentication:

  1. 🔑 Certificate Authentication (mTLS)

    • QWAC certificate for TLS client authentication
    • QSealC certificate for request signing
    • Required for all API requests
  2. 🔐 OAuth 2.0 Authorization

    • Authorization Code flow with PKCE
    • User consent and authentication
    • Access token for API requests

OAuth 2.0 Implementation

Authorization Code Flow with PKCE

Configuration Endpoint

Version-Specific Endpoints

OAuth endpoints are version-specific. Use the appropriate base path for your API version:

  • Berlin Group v1.3: https://open-banking-api.paysera.com/xs2a/berlin/1.3/
  • Georgia v0.8: https://open-banking-api.paysera.com/xs2a/georgia/0.8/
# For Berlin Group v1.3
https://open-banking-api.paysera.com/xs2a/berlin/1.3/.well-known/oauth-authorization-server

# For Georgia v0.8
https://open-banking-api.paysera.com/xs2a/georgia/0.8/.well-known/oauth-authorization-server

Mutual TLS (mTLS)

🔑 Certificate Configuration

mTLS Setup

Configure your HTTP client with certificates:

const https = require('https');
const fs = require('fs');

// Certificate configuration
const httpsAgent = new https.Agent({
cert: fs.readFileSync('path/to/qwac-cert.pem'),
key: fs.readFileSync('path/to/qwac-key.pem'),
ca: fs.readFileSync('path/to/ca-bundle.pem'),
rejectUnauthorized: true
});

// Using with fetch
const response = await fetch('https://open-banking-api.paysera.com/v1/accounts', {
agent: httpsAgent,
headers: {
'Authorization': `Bearer ${accessToken}`
}
});

Certificate Validation

Paysera validates:

  • ✅ Certificate chain to trusted CA
  • ✅ Certificate validity period
  • ✅ TPP authorization number in certificate
  • ✅ Certificate not revoked (OCSP check)

Scopes and Permissions

📋 Available OAuth Scopes

Account Information (AIS)

ScopeDescriptionAccess Level
accountsList accountsBasic account info
balancesAccount balancesReal-time balances
transactionsTransaction history90 days history
accounts-detailsFull account detailsAll account info

Payment Initiation (PIS)

ScopeDescriptionPayment TypesStatus
paymentsSingle paymentsDomestic, SEPA, RON✅ Supported
bulk-paymentsBulk paymentsMultiple transfers❌ Not supported
periodic-paymentsStanding ordersRecurring payments❌ Not supported
payment-cancellationCancel paymentsBefore execution✅ Supported
ScopeDescriptionOperations
consentsManage consentsCreate, view, delete
consent-validationValidate consentCheck validity

Scope Combinations

Common scope combinations:

// Read-only account access
scope: "accounts balances transactions"

// Payment initiation
scope: "payments payment-cancellation"

// Full access
scope: "accounts balances transactions payments consents"

Error Handling

⚠️ Common Errors and Solutions

OAuth Errors

ErrorDescriptionSolution
invalid_requestMissing or invalid parameterCheck required parameters
unauthorized_clientClient not authorizedVerify client_id
access_deniedUser denied consentHandle gracefully
invalid_scopeRequested scope invalidCheck available scopes
server_errorInternal server errorRetry with backoff

Certificate Errors

ErrorDescriptionSolution
certificate_invalidInvalid certificateCheck certificate validity
certificate_expiredCertificate expiredRenew certificate
certificate_not_foundCertificate not registeredRegister with Paysera
certificate_revokedCertificate revokedObtain new certificate

Token Errors

ErrorDescriptionSolution
invalid_tokenToken invalid or expiredRefresh token
insufficient_scopeToken lacks required scopeRequest new consent
token_expiredAccess token expiredUse refresh token
invalid_grantRefresh token invalidRe-authenticate user

Error Response Format

{
"error": "invalid_request",
"error_description": "The redirect_uri is missing",
"error_uri": "https://docs.paysera.com/errors#invalid_request"
}

Testing & Debugging

Common Issues

Certificate Issues:

# Test certificate connectivity
openssl s_client -connect open-banking-api.paysera.com:443 \
-cert qwac-cert.pem \
-key qwac-key.pem \
-CAfile ca-bundle.pem

Token Issues:

// Debug token expiry
console.log('Token expires at:', new Date(tokenExpiryTimestamp));
console.log('Time remaining:', tokenExpiryTimestamp - Date.now());

Request Debugging:

// Log all requests for debugging
console.log('Request:', {
url: request.url,
headers: request.headers,
method: request.method


## Resources

- 📖 [Getting Started Guide](/guides/open-banking/getting-started)
- 🔐 [Security Requirements](/guides/open-banking/getting-started/security)
- 💻 [Code Examples](/guides/open-banking/examples)
- 📚 [API Reference](/api/open-banking)
-[FAQ](/guides/open-banking/resources/faq)

:::tip[Pro Tips]
- Always implement PKCE for OAuth flows
- Cache discovery endpoint response
- Implement automatic token refresh before expiry
- Use SDK libraries when available
- Monitor certificate expiry dates proactively
:::