Authentication API

Authentication API

Overview

The Buburuza Authentication API provides secure access to all platform services using JWT tokens, OAuth 2.0, and optional biometric authentication. Built with bank-grade security standards and designed for both B2B integrations and consumer applications.

Authentication Methods

1. API Key Authentication (Server-to-Server)

For backend services and server-to-server communication.

curl -X GET https://api.buburuza.com/v1/customers \
  -H "Authorization: Bearer bb_live_1234567890abcdef" \
  -H "Content-Type: application/json"

2. OAuth 2.0 (User Authentication)

For applications that need to act on behalf of users.

// Redirect users to Buburuza OAuth
const authUrl = buburuza.auth.getAuthorizationUrl({
  clientId: 'your_client_id',
  redirectUri: 'https://yourapp.com/callback',
  scope: ['accounts:read', 'transactions:write'],
  state: 'random_state_string'
});

window.location.href = authUrl;

3. Biometric Authentication (Mobile)

For enhanced security on mobile applications.

API Endpoints

Generate Access Token

Exchange credentials for a JWT access token.

POST /v1/auth/token

Response:

Refresh Access Token

Obtain a new access token using a refresh token.

POST /v1/auth/refresh

Request:

Response:

Validate Token

Verify the validity and scope of an access token.

GET /v1/auth/validate

Response:

Revoke Token

Revoke an access or refresh token.

POST /v1/auth/revoke

OAuth 2.0 Flows

Authorization Code Flow

For web applications with secure backend.

Step 1: Authorization Request

Step 2: Exchange Code for Token

Client Credentials Flow

For machine-to-machine authentication.

PKCE Flow (Mobile Apps)

For mobile applications without secure storage.

Biometric Authentication

Setup Biometric Authentication

Register biometric credentials for a user.

POST /v1/auth/biometric/register

Authenticate with Biometrics

Verify user identity using biometric data.

POST /v1/auth/biometric/verify

Scopes and Permissions

Available Scopes

Scope
Description
Access Level

accounts:read

Read account information and balances

Read-only

accounts:write

Create and modify accounts

Read/Write

transactions:read

View transaction history

Read-only

transactions:write

Create transactions and transfers

Read/Write

cards:read

View card information

Read-only

cards:write

Issue and manage cards

Read/Write

investments:read

View portfolio and positions

Read-only

investments:write

Execute trades and manage portfolio

Read/Write

kyc:read

View KYC status and documents

Read-only

kyc:write

Initiate and manage KYC processes

Read/Write

ai:read

Access AI insights and analytics

Read-only

ai:write

Submit requests to AI services

Read/Write

Scope Examples

Security Best Practices

Token Storage

Token Refresh Strategy

Error Handling

Multi-Factor Authentication (MFA)

Enable MFA for User

POST /v1/auth/mfa/enable

Verify MFA Code

POST /v1/auth/mfa/verify

Webhook Authentication

Verify webhook requests are from Buburuza.

Rate Limiting

The Authentication API implements rate limiting to prevent abuse:

  • Token requests: 10 per minute per IP

  • Token validation: 100 per minute per token

  • Biometric authentication: 5 per minute per user

Testing Authentication

Sandbox Environment

Mock Biometric Authentication


Support and Resources

  • Authentication Guide: Detailed implementation examples

  • Security Best Practices: Industry-standard security recommendations

  • Troubleshooting: Common authentication issues and solutions

  • SDKs: Pre-built authentication handling in all supported languages

For additional help, contact our developer support team at [email protected].

Last updated