Authentication overview
Finicity (Mastercard) secures its APIs through a multi-layered authentication and authorization framework, centralizing on the OAuth 2.0 protocol. This industry-standard protocol enables applications to obtain limited access to user accounts on an HTTP service, such as Finicity's financial data aggregation and payment initiation platforms, without exposing user credentials to the client application (OAuth 2.0 specification details). For Finicity, developers authenticate their applications using a combination of unique credentials, including a Client ID, Client Secret, and an App Key, to establish trust and obtain access tokens.
The authentication process typically involves an application exchanging its client credentials for a temporary access token. This token, often a Bearer token, is then included in the header of subsequent API requests to authorize access to specific Finicity endpoints. This model ensures that only authorized applications can interact with the Finicity platform, providing a critical layer of security for sensitive financial data and transactions. Finicity's approach aligns with open banking principles, prioritizing secure and controlled data sharing as outlined in their official documentation (Finicity developer documentation).
Supported authentication methods
Finicity primarily utilizes the OAuth 2.0 Client Credentials Grant flow for server-to-server communication, which is suitable for applications that do not involve a direct user interface to obtain user consent. This method is designed for confidential clients that can securely store their client secret. The process involves your application making a direct request to Finicity's authorization server to exchange its Client ID and Client Secret for an access token. This token then acts as proof of authentication and authorization for subsequent API calls.
While the Client Credentials Grant is the foundational method for application-level authentication, Finicity's platform also incorporates mechanisms for user consent and authorization when accessing end-user financial data. This typically happens through secure redirects or embedded experiences where the end-user authenticates directly with their financial institution, and Finicity then facilitates the secure data transfer based on that explicit consent. This user-centric authorization is crucial for compliance with data privacy regulations like GDPR and CCPA, as well as industry standards for open banking.
Authentication Method Summary
| Method | When to Use | Security Level |
|---|---|---|
| OAuth 2.0 Client Credentials Grant | Server-to-server API calls where your application needs to authenticate itself to Finicity. Ideal for backend services, data processing, and payment initiation requests. | High. Relies on secure storage of client credentials and temporary, revocable access tokens. |
| User-Initiated Authorization (via Connect Flow) | When your application needs to access end-user financial data or initiate payments on behalf of a user. The user authenticates directly with their financial institution. | High. Employs strong customer authentication (SCA) at the financial institution level and explicit user consent for data sharing. |
Getting your credentials
To begin integrating with Finicity, you must first obtain your developer credentials. This process typically involves registering as a developer on the Finicity developer portal and setting up an application. Upon successful registration and application setup, Finicity will issue the necessary credentials for accessing their sandbox and production environments.
- Developer Portal Registration: Navigate to the Finicity developer portal (accessible via Finicity's documentation page) and sign up for a developer account. This typically requires providing basic contact information and agreeing to the terms of service.
- Application Setup: Once registered, create a new application within your developer dashboard. During this step, you will define the scope and purpose of your application, which helps Finicity understand its intended use and apply appropriate access policies.
- Credential Issuance: After creating your application, Finicity will provide you with your unique
Client ID,Client Secret, and anApp Key. These are the primary credentials you will use to authenticate your application with Finicity's APIs.
It is critical to treat these credentials with the utmost care. The Client Secret, in particular, should be stored securely and never exposed in client-side code or publicly accessible repositories. Finicity provides guidance on secure credential management within its developer documentation, emphasizing practices like environment variables or secure vault services for storing sensitive information (Finicity API documentation).
Authenticated request example
Once you have obtained your Client ID, Client Secret, and App Key, the first step in making an authenticated request is to obtain an access token. This is typically done by sending a POST request to Finicity's token endpoint.
Step 1: Obtain an Access Token
This example demonstrates how to request a Finicity access token using curl. Replace YOUR_CLIENT_ID, YOUR_CLIENT_SECRET, and YOUR_APP_KEY with your actual credentials.
curl -X POST \
https://api.finicity.com/oauth/token \
-H 'Content-Type: application/json' \
-H 'Finicity-App-Key: YOUR_APP_KEY' \
-d '{
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"grant_type": "client_credentials"
}'
A successful response will include an access_token and an expires_in value, indicating the token's validity period. The access_token is a Bearer token that you will use in subsequent API calls.
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}
Step 2: Make an Authenticated API Call
With the access token in hand, you can now make authenticated requests to other Finicity API endpoints. Include the access_token in the Authorization header as a Bearer token, along with your Finicity-App-Key.
This example retrieves a list of customers:
curl -X GET \
https://api.finicity.com/aggregation/v2/customers \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Finicity-App-Key: YOUR_APP_KEY' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN'
Remember to replace YOUR_APP_KEY and YOUR_ACCESS_TOKEN with your actual values. The Finicity API reference provides detailed information on all available endpoints and their required parameters (Finicity API Reference).
Security best practices
Implementing robust security measures is paramount when working with financial APIs like Finicity's. Adhering to these best practices will help protect your application and your users' sensitive data.
- Secure Credential Storage: Never hardcode your
Client SecretorApp Keydirectly into your application code. Use environment variables, secure configuration files, or a secrets management service (e.g., AWS Secrets Manager, Google Cloud Secret Manager, Azure Key Vault) to store sensitive credentials. Ensure these storage mechanisms are protected with appropriate access controls. Microsoft provides guidance on data protection fundamentals that can be applied to credential storage. - Token Management: Access tokens have a limited lifespan. Implement mechanisms to refresh tokens before they expire to maintain continuous access without requiring re-authentication. Store tokens securely in memory for the duration of their validity and invalidate them immediately if a security compromise is suspected.
- HTTPS Everywhere: Always use HTTPS for all communication with Finicity APIs. This encrypts data in transit, preventing eavesdropping and tampering. Finicity's endpoints enforce HTTPS, but it's crucial to ensure your application also uses secure connections for all its external communications.
- Least Privilege Principle: Grant your application only the minimum necessary permissions required to perform its intended functions. Review Finicity's available scopes and ensure your application requests and operates within the narrowest possible set of permissions.
- Error Handling and Logging: Implement comprehensive error handling and logging for authentication and authorization failures. This helps in detecting and responding to potential security incidents. However, be cautious not to log sensitive information like raw credentials or access tokens.
- Input Validation: Always validate and sanitize all input from users and external systems before processing it. This helps prevent common web vulnerabilities such as injection attacks that could compromise your application's security.
- Regular Security Audits: Periodically review your application's security posture, including code audits, penetration testing, and vulnerability scanning. Stay updated on Finicity's security advisories and best practice recommendations.
- Compliance with Regulations: Ensure your application's data handling and security practices comply with relevant financial regulations and data privacy laws, such as SOC 2 Type II, GDPR, and CCPA, which Finicity itself adheres to.