Overview
The Aries API uses OAuth2 with Bearer tokens (JWT format) for authentication. All API requests require a valid access token in the Authorization header.Authentication Flow
1. OAuth2 Client Credentials
First, obtain your OAuth2 credentials from the Aries platform:- Client ID: Your application identifier
- Client Secret: Your application secret key
2. Initialize the SDK
OAuth2 Authorization Flow
Authorization Code Flow
For applications that need user authorization:PKCE Support
For enhanced security in public clients (mobile apps, SPAs):MFA Verification
If MFA is enabled:Token Management
Refreshing Access Tokens
Access tokens expire after a set period. Use refresh tokens to obtain new access tokens:Automatic Token Refresh
The SDK automatically refreshes tokens when they expire:Using Bearer Tokens Directly
If you already have an access token:Security Best Practices
1. Store Credentials Securely
Never hardcode credentials in your source code:2. Use Environment Variables
Create a.env file (add to .gitignore):
3. Handle Token Expiration
4. Scope Limitations
Request only the scopes you need:OAuth2 Scopes
Available scopes:read- Read account data, positions, and orderstrade- Place and cancel orderswithdraw- Withdraw funds from accountadmin- Administrative operations
Error Handling
Rate Limiting
The Aries API enforces rate limits. If you exceed the limit:Complete Example
Next Steps
- Quick Start Guide - Get started with basic operations
- Users API - Manage user accounts and profiles
- Orders API - Place and manage trades