Authentication overview
Real Time Finance provides secure API access to its suite of financial services, including real-time payments, transaction monitoring, and fraud prevention. Authentication is a critical component for all interactions with the Real Time Finance API, ensuring that only authorized applications and users can initiate transactions or retrieve sensitive financial data. The platform supports industry-standard authentication protocols designed to integrate seamlessly while upholding stringent security and compliance requirements, such as PCI DSS Level 1 and SOC 2 Type II compliance. Proper authentication safeguards against unauthorized access, data breaches, and ensures the integrity of financial operations.
Developers interacting with the Real Time Finance API must first establish their identity using credentials obtained through the developer dashboard. These credentials are then used to sign API requests, allowing the Real Time Finance system to verify the request's origin and grant access to the requested resources. The choice of authentication method often depends on the type of application being built and the level of access required, ranging from server-to-server integrations to user-facing applications requiring delegated access.
Supported authentication methods
Real Time Finance primarily supports two robust authentication methods to cater to various integration patterns:
- API Keys: This is the simplest and most common method for server-to-server communication. An API key is a unique token that identifies your application and grants it access to the Real Time Finance API. API keys are suitable for backend services where the key can be kept confidential and not exposed to client-side code.
- OAuth 2.0 Client Credentials Grant: For more complex applications, particularly those requiring delegated authorization or where user consent is involved, OAuth 2.0 is the recommended approach. The Client Credentials Grant type is specifically used for machine-to-machine authentication where a client application requests access to protected resources on its own behalf, rather than on behalf of an end-user. This involves exchanging a client ID and client secret for an access token, which is then used to authorize API requests. Learn more about the OAuth 2.0 Client Credentials flow.
Authentication Method Comparison
| Method | When to Use | Security Level | Complexity |
|---|---|---|---|
| API Key | Server-to-server backend applications, scripts, internal tools | High (if securely stored) | Low |
| OAuth 2.0 (Client Credentials) | Server-side applications acting on their own behalf, microservices | Very High | Medium |
Getting your credentials
To begin authenticating with the Real Time Finance API, you must first obtain your API keys or OAuth 2.0 client credentials. This process is managed through the Real Time Finance Developer Dashboard:
- Sign Up/Log In: Navigate to the Real Time Finance website and sign up for a new developer account or log in to an existing one.
- Access Developer Dashboard: Once logged in, locate and access the Developer Dashboard. This is usually found under a "Developers," "API," or "Settings" section.
- Create Project/Application: You may need to create a new project or application within the dashboard. This helps organize your API keys and track usage.
- Generate API Keys: For API Key authentication, look for a section dedicated to "API Keys" or "Credentials." You will typically be able to generate both "Publishable" (for client-side use, though not generally for direct API calls to Real Time Finance) and "Secret" keys. The Secret Key is critical for server-side authentication and must be kept strictly confidential.
- Obtain OAuth Client Credentials: If using OAuth 2.0, you will likely find a section to register an application, which will provide you with a Client ID and Client Secret. These are your credentials for initiating the OAuth flow.
- Sandbox vs. Live Credentials: Real Time Finance offers a Developer Sandbox environment for testing. Ensure you generate and use the appropriate credentials for either the sandbox or live production environment as needed. Sandbox credentials will not work in the live environment, and vice-versa.
For detailed, step-by-step instructions and visual guides, refer to the official Real Time Finance developer documentation.
Authenticated request example
Here's an example of how to make an authenticated request using an API key in Python, one of the primary language examples supported by Real Time Finance SDKs. This example targets a hypothetical endpoint for retrieving transaction details.
Using an API Key (Python):
import requests
import os
# It's best practice to load your API key from environment variables
REALTIME_FINANCE_API_KEY = os.environ.get("REALTIME_FINANCE_SECRET_KEY")
# Ensure the API key is set
if not REALTIME_FINANCE_API_KEY:
raise ValueError("REALTIME_FINANCE_SECRET_KEY environment variable not set.")
# Replace with your actual transaction ID
transaction_id = "txn_abc123xyz456"
api_base_url = "https://api.realtimefinance.com/v1" # Check Real Time Finance API reference for correct base URL
headers = {
"Authorization": f"Bearer {REALTIME_FINANCE_API_KEY}",
"Content-Type": "application/json"
}
response = requests.get(f"{api_base_url}/transactions/{transaction_id}", headers=headers)
if response.status_code == 200:
print("Transaction details:")
print(response.json())
else:
print(f"Error retrieving transaction: {response.status_code} - {response.text}")
This example demonstrates sending the API key in the Authorization header using the Bearer scheme, which is a common practice for secret tokens. For more examples in other supported SDKs (Node.js, Java, PHP, Ruby) and detailed endpoint specifications, consult the Real Time Finance API reference documentation.
Security best practices
Adhering to security best practices is paramount when handling financial data and authenticating with the Real Time Finance API:
- Keep Secret Keys Confidential: Never expose your API Secret Keys or OAuth Client Secrets in client-side code, public repositories, or commit them directly into your codebase. Use environment variables, secure configuration management systems, or secrets management services (e.g., AWS Secrets Manager, Google Cloud Secret Manager, Azure Key Vault) to store and retrieve these credentials securely.
- Use HTTPS Everywhere: All communication with the Real Time Finance API must occur over HTTPS to encrypt data in transit and prevent eavesdropping. The Real Time Finance API endpoints inherently enforce HTTPS.
- Rotate API Keys Regularly: Periodically rotate your API keys. This practice minimizes the window of opportunity for an attacker if a key is compromised. The Real Time Finance Developer Dashboard provides functionality to generate new keys and revoke old ones.
- Implement Least Privilege: Grant only the necessary permissions to your API keys or OAuth clients. If an API key only needs to read transaction data, do not grant it permission to initiate payments. Configure roles and permissions within your Real Time Finance account where available.
- Monitor API Usage: Regularly review API logs and usage patterns for any unusual activity. Anomalies could indicate a compromise or misuse of your credentials.
- Secure Your Development Environment: Ensure that your development machines and build pipelines are secured against unauthorized access. This includes using strong passwords, multi-factor authentication, and keeping software updated.
- Validate Webhooks: If your integration uses webhooks from Real Time Finance, always verify the signature of incoming webhooks to ensure they genuinely originate from Real Time Finance and have not been tampered with. The Real Time Finance documentation provides guidance on webhook signature verification.
- Error Handling: Implement robust error handling for authentication failures. Avoid providing verbose error messages that could leak sensitive information about your authentication setup.
- SDK Utilization: Where available, leverage the official Real Time Finance SDKs (e.g., Python, Node.js, Java). These SDKs are designed to handle authentication securely and efficiently, often abstracting away the complexities of HTTP requests and header formatting.
By diligently following these best practices, developers can significantly enhance the security posture of their applications integrating with Real Time Finance, protecting both their systems and their users' financial data. For the most up-to-date security recommendations specific to Real Time Finance, always consult their official security documentation.